diff --git a/angular-cookie/angular-cookie-tests.ts b/angular-cookie/angular-cookie-tests.ts new file mode 100644 index 000000000..e6280fbeb --- /dev/null +++ b/angular-cookie/angular-cookie-tests.ts @@ -0,0 +1,21 @@ +/// +/// + +angular.module('myApp', ['ipCookie']) + .controller('cookieController', ['ipCookie', function(ipCookie: angular.cookie.CookieService) { + ipCookie('key', 'value'); + ipCookie('key', { value: 'value'}); + ipCookie('key', [1, 2, 3]); + + ipCookie('key', 'value', { expires: 21 }); + ipCookie('key', 'value', { encode: function (value) { return value; } }); + + ipCookie(); + ipCookie('key'); + ipCookie('key', undefined, {decode: function (value) { return value; }}); + + ipCookie.remove('key'); + ipCookie.remove('key', { path: '/some/path/' }); + + var obj: Object = '255'; + }]); \ No newline at end of file diff --git a/angular-cookie/angular-cookie.d.ts b/angular-cookie/angular-cookie.d.ts new file mode 100644 index 000000000..99041f934 --- /dev/null +++ b/angular-cookie/angular-cookie.d.ts @@ -0,0 +1,65 @@ +// Type definitions for angular-cookie v4.1.0 +// Project: https://github.com/ivpusic/angular-cookie +// Definitions by: Borislav Zhivkov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module angular.cookie { + interface CookieService { + /** + * Get all cookies + */ + (): any; + + /** + * Get a cookie with a specific key + */ + (key: string): any; + + /** + * Create a cookie + */ + (key: string, value: any, options?: CookieOptions): any; + + /** + * Remove a cookie + */ + remove(key: string, options?: CookieOptions): void; + } + + interface CookieOptions { + /** + * The domain tells the browser to which domain the cookie should be sent. If you don't specify it, it becomes the domain of the page that sets the cookie. + */ + domain?: string; + + /** + * The path gives you the chance to specify a directory where the cookie is active. + */ + path?: string; + + /** + * Each cookie has an expiry date after which it is trashed. If you don't specify the expiry date the cookie is trashed when you close the browser. + */ + expires?: number; + + /** + * Allows you to set the expiration time in hours, minutes, seconds, or `milliseconds. If this is not specified, any expiration time specified will default to days. + */ + expirationUnit?: string; + + /** + * The Secure attribute is meant to keep cookie communication limited to encrypted transmission, directing browsers to use cookies only via secure/encrypted connections. + */ + secure?: boolean; + + /** + * The method that will be used to encode the cookie value (should be passed when using Set). + */ + encode?: (value: any) => any; + + /** + * The method that will be used to decode extracted cookie values (should be passed when using Get). + */ + decode?: (value: any) => any; + } +} \ No newline at end of file diff --git a/angular-load/angular-load-tests.ts b/angular-load/angular-load-tests.ts new file mode 100644 index 000000000..b7d7c2e60 --- /dev/null +++ b/angular-load/angular-load-tests.ts @@ -0,0 +1,12 @@ +/// + +angular.module('app',['angularLoad']) + .run(['angularLoad',(angularLoad:angular.load.IAngularLoadService)=> { + angularLoad.loadScript("https://ajax.googleapis.com/ajax/libs/angular_material/1.0.4/angular-material.min.js").then( + ()=>console.log("angular material js loaded") + ); + + angularLoad.loadCss("https://ajax.googleapis.com/ajax/libs/angular_material/1.0.4/angular-material.css").then( + ()=>console.log("angular material css loaded") + ); + }]); diff --git a/angular-load/angular-load.d.ts b/angular-load/angular-load.d.ts new file mode 100644 index 000000000..a35d1c59d --- /dev/null +++ b/angular-load/angular-load.d.ts @@ -0,0 +1,15 @@ +// Type definitions for angular-load v0.4.1 +// Project: https://github.com/urish/angular-load +// Definitions by: david-gang +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module angular.load { + + interface IAngularLoadService { + loadScript(url:string): ng.IPromise; + loadCss(url:string): ng.IPromise; + } + +} diff --git a/atom/atom.d.ts b/atom/atom.d.ts index 9483f103c..bf0834dc6 100644 --- a/atom/atom.d.ts +++ b/atom/atom.d.ts @@ -165,7 +165,7 @@ declare module AtomCore { } interface ICommandRegistry { - add(selector: string, name: string, callback: (event: any) => void): void; // selector:'atom-editor'|'atom-workspace' + add(target: string, commandName: Object, callback?: (event: any) => void): any; // selector:'atom-editor'|'atom-workspace' findCommands(params: Object): Object[]; dispatch(selector: any, name:string): void; } @@ -589,6 +589,7 @@ declare module AtomCore { subscriptionCounts: any; subscriptionsByObject: any; /* WeakMap */ subscriptions: Emissary.ISubscription[]; + destroy():void; mini: any; @@ -780,6 +781,7 @@ declare module AtomCore { moveCursorToNextWordBoundary():void; moveCursorToBeginningOfNextParagraph():void; moveCursorToBeginningOfPreviousParagraph():void; + moveToBottom():void; scrollToCursorPosition(options:any):any; pageUp():void; pageDown():void; diff --git a/axios/axios-tests.ts b/axios/axios-tests.ts index 184292c92..040994531 100644 --- a/axios/axios-tests.ts +++ b/axios/axios-tests.ts @@ -18,11 +18,33 @@ axios.interceptors.request.use(config => { return config; }); + +const requestId: number = axios.interceptors.request.use( + (config) => { + console.log("Method:" + config.method + " Url:" +config.url); + return config; + }, + (error: any) => error); + + +axios.interceptors.request.eject(requestId); +axios.interceptors.request.eject(7); + + axios.interceptors.response.use(config => { console.log("Status:" + config.status); return config; }); +const responseId: number = axios.interceptors.response.use( + config => { + console.log("Status:" + config.status); + return config; + }, + (error: any) => error); + +axios.interceptors.response.eject(responseId); + axios.get("https://api.github.com/repos/mzabriskie/axios") .then(r => console.log(r.config.method)); diff --git a/axios/axios.d.ts b/axios/axios.d.ts index 7348ec651..5b610c1c1 100644 --- a/axios/axios.d.ts +++ b/axios/axios.d.ts @@ -1,4 +1,4 @@ -// Type definitions for axios 0.8.1 +// Type definitions for axios 0.9.1 // Project: https://github.com/mzabriskie/axios // Definitions by: Marcel Buesing // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -167,18 +167,34 @@ declare module Axios { response: ResponseInterceptor } + type InterceptorId = number; + interface RequestInterceptor { /** * - request body data type */ - use(fn: (config: AxiosXHRConfig) => AxiosXHRConfig): void; + + use(fulfilledFn: (config: AxiosXHRConfig) => AxiosXHRConfig): InterceptorId; + + use(fulfilledFn: (config: AxiosXHRConfig) => AxiosXHRConfig, + rejectedFn: (error: any) => any) + : InterceptorId; + + eject(interceptorId: InterceptorId): void; } interface ResponseInterceptor { /** * - expected response type */ - use(fn: (config: AxiosXHR) => AxiosXHR): void; + + use(fulfilledFn: (config: Axios.AxiosXHR) => Axios.AxiosXHR): InterceptorId; + + use(fulfilledFn: (config: Axios.AxiosXHR) => Axios.AxiosXHR, + rejectedFn: (error: any) => any) + : InterceptorId; + + eject(interceptorId: InterceptorId): void; } /** diff --git a/babyparse/babyparse-tests.ts b/babyparse/babyparse-tests.ts new file mode 100644 index 000000000..29d2d2289 --- /dev/null +++ b/babyparse/babyparse-tests.ts @@ -0,0 +1,1230 @@ +/// +import * as Baby from "babyparse"; + +var RECORD_SEP = String.fromCharCode(30); +var UNIT_SEP = String.fromCharCode(31); + +interface ParserTestExpectedResult { + data: any[]; + errors: any[]; +} + +interface ParserTestCompareResult { + data: ParserTestPassFail; + errors: ParserTestPassFail; +} + +interface ParserTestPassFail { + passed: boolean; +} + +interface ParserTest { + description: string; + input: string; + expected: ParserTestExpectedResult; + notes?: string; + config?: BabyParse.ParseConfig; +} +// Tests for the core parser using new Baby.Parser().parse() (CSV to JSON) +var CORE_PARSER_TESTS: ParserTest[] = [ + { + description: "One row", + input: 'A,b,c', + expected: { + data: [['A', 'b', 'c']], + errors: [] + } + }, + { + description: "Two rows", + input: 'A,b,c\nd,E,f', + expected: { + data: [['A', 'b', 'c'], ['d', 'E', 'f']], + errors: [] + } + }, + { + description: "Three rows", + input: 'A,b,c\nd,E,f\nG,h,i', + expected: { + data: [['A', 'b', 'c'], ['d', 'E', 'f'], ['G', 'h', 'i']], + errors: [] + } + }, + { + description: "Whitespace at edges of unquoted field", + input: 'a, b ,c', + notes: "Extra whitespace should graciously be preserved", + expected: { + data: [['a', ' b ', 'c']], + errors: [] + } + }, + { + description: "Quoted field", + input: 'A,"B",C', + expected: { + data: [['A', 'B', 'C']], + errors: [] + } + }, + { + description: "Quoted field with extra whitespace on edges", + input: 'A," B ",C', + expected: { + data: [['A', ' B ', 'C']], + errors: [] + } + }, + { + description: "Quoted field with delimiter", + input: 'A,"B,B",C', + expected: { + data: [['A', 'B,B', 'C']], + errors: [] + } + }, + { + description: "Quoted field with line break", + input: 'A,"B\nB",C', + expected: { + data: [['A', 'B\nB', 'C']], + errors: [] + } + }, + { + description: "Quoted fields with line breaks", + input: 'A,"B\nB","C\nC\nC"', + expected: { + data: [['A', 'B\nB', 'C\nC\nC']], + errors: [] + } + }, + { + description: "Quoted fields at end of row with delimiter and line break", + input: 'a,b,"c,c\nc"\nd,e,f', + expected: { + data: [['a', 'b', 'c,c\nc'], ['d', 'e', 'f']], + errors: [] + } + }, + { + description: "Quoted field with escaped quotes", + input: 'A,"B""B""B",C', + expected: { + data: [['A', 'B"B"B', 'C']], + errors: [] + } + }, + { + description: "Quoted field with escaped quotes at boundaries", + input: 'A,"""B""",C', + expected: { + data: [['A', '"B"', 'C']], + errors: [] + } + }, + { + description: "Unquoted field with quotes at end of field", + notes: "The quotes character is misplaced, but shouldn't generate an error or break the parser", + input: 'A,B",C', + expected: { + data: [['A', 'B"', 'C']], + errors: [] + } + }, + { + description: "Quoted field with quotes around delimiter", + input: 'A,""",""",C', + notes: "For a boundary to exist immediately before the quotes, we must not already be in quotes", + expected: { + data: [['A', '","', 'C']], + errors: [] + } + }, + { + description: "Quoted field with quotes on right side of delimiter", + input: 'A,",""",C', + notes: "Similar to the test above but with quotes only after the comma", + expected: { + data: [['A', ',"', 'C']], + errors: [] + } + }, + { + description: "Quoted field with quotes on left side of delimiter", + input: 'A,""",",C', + notes: "Similar to the test above but with quotes only before the comma", + expected: { + data: [['A', '",', 'C']], + errors: [] + } + }, + { + description: "Quoted field with 5 quotes in a row and a delimiter in there, too", + input: '"1","cnonce="""",nc=""""","2"', + notes: "Actual input reported in issue #121", + expected: { + data: [['1', 'cnonce="",nc=""', '2']], + errors: [] + } + }, + { + description: "Quoted field with whitespace around quotes", + input: 'A, "B" ,C', + notes: "The quotes must be immediately adjacent to the delimiter to indicate a quoted field", + expected: { + data: [['A', ' "B" ', 'C']], + errors: [] + } + }, + { + description: "Misplaced quotes in data, not as opening quotes", + input: 'A,B "B",C', + notes: "The input is technically malformed, but this syntax should not cause an error", + expected: { + data: [['A', 'B "B"', 'C']], + errors: [] + } + }, + { + description: "Quoted field has no closing quote", + input: 'a,"b,c\nd,e,f', + expected: { + data: [['a', 'b,c\nd,e,f']], + errors: [{ + "type": "Quotes", + "code": "MissingQuotes", + "message": "Quoted field unterminated", + "row": 0, + "index": 3 + }] + } + }, + { + description: "Line starts with quoted field", + input: 'a,b,c\n"d",e,f', + expected: { + data: [['a', 'b', 'c'], ['d', 'e', 'f']], + errors: [] + } + }, + { + description: "Line ends with quoted field", + input: 'a,b,c\nd,e,f\n"g","h","i"\n"j","k","l"', + expected: { + data: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i'], ['j', 'k', 'l']], + errors: [] + } + }, + { + description: "Quoted field at end of row (but not at EOF) has quotes", + input: 'a,b,"c""c"""\nd,e,f', + expected: { + data: [['a', 'b', 'c"c"'], ['d', 'e', 'f']], + errors: [] + } + }, + { + description: "Multiple consecutive empty fields", + input: 'a,b,,,c,d\n,,e,,,f', + expected: { + data: [['a', 'b', '', '', 'c', 'd'], ['', '', 'e', '', '', 'f']], + errors: [] + } + }, + { + description: "Empty input string", + input: '', + expected: { + data: [], + errors: [] + } + }, + { + description: "Input is just the delimiter (2 empty fields)", + input: ',', + expected: { + data: [['', '']], + errors: [] + } + }, + { + description: "Input is just empty fields", + input: ',,\n,,,', + expected: { + data: [['', '', ''], ['', '', '', '']], + errors: [] + } + }, + { + description: "Input is just a string (a single field)", + input: 'Abc def', + expected: { + data: [['Abc def']], + errors: [] + } + }, + { + description: "Commented line at beginning", + input: '# Comment!\na,b,c', + config: { comments: true }, + expected: { + data: [['a', 'b', 'c']], + errors: [] + } + }, + { + description: "Commented line in middle", + input: 'a,b,c\n# Comment\nd,e,f', + config: { comments: true }, + expected: { + data: [['a', 'b', 'c'], ['d', 'e', 'f']], + errors: [] + } + }, + { + description: "Commented line at end", + input: 'a,true,false\n# Comment', + config: { comments: true }, + expected: { + data: [['a', 'true', 'false']], + errors: [] + } + }, + { + description: "Two comment lines consecutively", + input: 'a,b,c\n#comment1\n#comment2\nd,e,f', + config: { comments: true }, + expected: { + data: [['a', 'b', 'c'], ['d', 'e', 'f']], + errors: [] + } + }, + { + description: "Two comment lines consecutively at end of file", + input: 'a,b,c\n#comment1\n#comment2', + config: { comments: true }, + expected: { + data: [['a', 'b', 'c']], + errors: [] + } + }, + { + description: "Three comment lines consecutively at beginning of file", + input: '#comment1\n#comment2\n#comment3\na,b,c', + config: { comments: true }, + expected: { + data: [['a', 'b', 'c']], + errors: [] + } + }, + { + description: "Entire file is comment lines", + input: '#comment1\n#comment2\n#comment3', + config: { comments: true }, + expected: { + data: [], + errors: [] + } + }, + // { + // description: "Comment with non-default character", + // input: 'a,b,c\n!Comment goes here\nd,e,f', + // config: { comments: '!' }, + // expected: { + // data: [['a', 'b', 'c'], ['d', 'e', 'f']], + // errors: [] + // } + // }, + // { + // description: "Bad comments value specified", + // notes: "Should silently disable comment parsing", + // input: 'a,b,c\n5comment\nd,e,f', + // config: { comments: 5 }, + // expected: { + // data: [['a', 'b', 'c'], ['5comment'], ['d', 'e', 'f']], + // errors: [] + // } + // }, + // { + // description: "Multi-character comment string", + // input: 'a,b,c\n=N(Comment)\nd,e,f', + // config: { comments: "=N(" }, + // expected: { + // data: [['a', 'b', 'c'], ['d', 'e', 'f']], + // errors: [] + // } + // }, + { + description: "Input with only a commented line", + input: '#commented line', + config: { comments: true, delimiter: ',' }, + expected: { + data: [], + errors: [] + } + }, + { + description: "Input with only a commented line and blank line after", + input: '#commented line\n', + config: { comments: true, delimiter: ',' }, + expected: { + data: [['']], + errors: [] + } + }, + { + description: "Input with only a commented line, without comments enabled", + input: '#commented line', + config: { delimiter: ',' }, + expected: { + data: [['#commented line']], + errors: [] + } + }, + { + description: "Input without comments with line starting with whitespace", + input: 'a\n b\nc', + config: { delimiter: ',' }, + notes: "\" \" == false, but \" \" !== false, so === comparison is required", + expected: { + data: [['a'], [' b'], ['c']], + errors: [] + } + }, + { + description: "Multiple rows, one column (no delimiter found)", + input: 'a\nb\nc\nd\ne', + expected: { + data: [['a'], ['b'], ['c'], ['d'], ['e']], + errors: [] + } + }, + { + description: "One column input with empty fields", + input: 'a\nb\n\n\nc\nd\ne\n', + expected: { + data: [['a'], ['b'], [''], [''], ['c'], ['d'], ['e'], ['']], + errors: [] + } + }, + { + description: "Fast mode, basic", + input: 'a,b,c\nd,e,f', + config: { fastMode: true }, + expected: { + data: [['a', 'b', 'c'], ['d', 'e', 'f']], + errors: [] + } + }, + // { + // description: "Fast mode with comments", + // input: '// Commented line\na,b,c', + // config: { fastMode: true, comments: "//" }, + // expected: { + // data: [['a', 'b', 'c']], + // errors: [] + // } + // }, + { + description: "Fast mode with preview", + input: 'a,b,c\nd,e,f\nh,j,i\n', + config: { fastMode: true, preview: 2 }, + expected: { + data: [['a', 'b', 'c'], ['d', 'e', 'f']], + errors: [] + } + }, + { + description: "Fast mode with blank line at end", + input: 'a,b,c\n', + config: { fastMode: true }, + expected: { + data: [['a', 'b', 'c'], ['']], + errors: [] + } + } +]; + + +// Tests for Baby.parse() function -- high-level wrapped parser (CSV to JSON) +var PARSE_TESTS: ParserTest[] = [ + { + description: "Two rows, just \\r", + input: 'A,b,c\rd,E,f', + expected: { + data: [['A', 'b', 'c'], ['d', 'E', 'f']], + errors: [] + } + }, + { + description: "Two rows, \\r\\n", + input: 'A,b,c\r\nd,E,f', + expected: { + data: [['A', 'b', 'c'], ['d', 'E', 'f']], + errors: [] + } + }, + { + description: "Quoted field with \\r\\n", + input: 'A,"B\r\nB",C', + expected: { + data: [['A', 'B\r\nB', 'C']], + errors: [] + } + }, + { + description: "Quoted field with \\r", + input: 'A,"B\rB",C', + expected: { + data: [['A', 'B\rB', 'C']], + errors: [] + } + }, + { + description: "Quoted field with \\n", + input: 'A,"B\nB",C', + expected: { + data: [['A', 'B\nB', 'C']], + errors: [] + } + }, + { + description: "Header row with one row of data", + input: 'A,B,C\r\na,b,c', + config: { header: true }, + expected: { + data: [{ "A": "a", "B": "b", "C": "c" }], + errors: [] + } + }, + { + description: "Header row only", + input: 'A,B,C', + config: { header: true }, + expected: { + data: [], + errors: [] + } + }, + { + description: "Row with too few fields", + input: 'A,B,C\r\na,b', + config: { header: true }, + expected: { + data: [{ "A": "a", "B": "b" }], + errors: [{ + "type": "FieldMismatch", + "code": "TooFewFields", + "message": "Too few fields: expected 3 fields but parsed 2", + "row": 0 + }] + } + }, + { + description: "Row with too many fields", + input: 'A,B,C\r\na,b,c,d,e\r\nf,g,h', + config: { header: true }, + expected: { + data: [{ "A": "a", "B": "b", "C": "c", "__parsed_extra": ["d", "e"] }, { "A": "f", "B": "g", "C": "h" }], + errors: [{ + "type": "FieldMismatch", + "code": "TooManyFields", + "message": "Too many fields: expected 3 fields but parsed 5", + "row": 0 + }] + } + }, + { + description: "Row with enough fields but blank field at end", + input: 'A,B,C\r\na,b,', + config: { header: true }, + expected: { + data: [{ "A": "a", "B": "b", "C": "" }], + errors: [] + } + }, + { + description: "Tab delimiter", + input: 'a\tb\tc\r\nd\te\tf', + config: { delimiter: "\t" }, + expected: { + data: [['a', 'b', 'c'], ['d', 'e', 'f']], + errors: [] + } + }, + { + description: "Pipe delimiter", + input: 'a|b|c\r\nd|e|f', + config: { delimiter: "|" }, + expected: { + data: [['a', 'b', 'c'], ['d', 'e', 'f']], + errors: [] + } + }, + { + description: "ASCII 30 delimiter", + input: 'a' + RECORD_SEP + 'b' + RECORD_SEP + 'c\r\nd' + RECORD_SEP + 'e' + RECORD_SEP + 'f', + config: { delimiter: RECORD_SEP }, + expected: { + data: [['a', 'b', 'c'], ['d', 'e', 'f']], + errors: [] + } + }, + { + description: "ASCII 31 delimiter", + input: 'a' + UNIT_SEP + 'b' + UNIT_SEP + 'c\r\nd' + UNIT_SEP + 'e' + UNIT_SEP + 'f', + config: { delimiter: UNIT_SEP }, + expected: { + data: [['a', 'b', 'c'], ['d', 'e', 'f']], + errors: [] + } + }, + { + description: "Bad delimiter", + input: 'a,b,c', + config: { delimiter: "DELIM" }, + notes: "Should silently default to comma", + expected: { + data: [['a', 'b', 'c']], + errors: [] + } + }, + { + description: "Dynamic typing converts numeric literals", + input: '1,2.2,1e3\r\n-4,-4.5,-4e-5\r\n-,5a,5-2', + config: { dynamicTyping: true }, + expected: { + data: [[1, 2.2, 1000], [-4, -4.5, -0.00004], ["-", "5a", "5-2"]], + errors: [] + } + }, + { + description: "Dynamic typing converts boolean literals", + input: 'true,false,T,F,TRUE,False', + config: { dynamicTyping: true }, + expected: { + data: [[true, false, "T", "F", "TRUE", "False"]], + errors: [] + } + }, + { + description: "Dynamic typing doesn't convert other types", + input: 'A,B,C\r\nundefined,null,[\r\nvar,float,if', + config: { dynamicTyping: true }, + expected: { + data: [["A", "B", "C"], ["undefined", "null", "["], ["var", "float", "if"]], + errors: [] + } + }, + { + description: "Blank line at beginning", + input: '\r\na,b,c\r\nd,e,f', + config: { newline: '\r\n' }, + expected: { + data: [[''], ['a', 'b', 'c'], ['d', 'e', 'f']], + errors: [] + } + }, + { + description: "Blank line in middle", + input: 'a,b,c\r\n\r\nd,e,f', + config: { newline: '\r\n' }, + expected: { + data: [['a', 'b', 'c'], [''], ['d', 'e', 'f']], + errors: [] + } + }, + { + description: "Blank lines at end", + input: 'a,b,c\nd,e,f\n\n', + expected: { + data: [['a', 'b', 'c'], ['d', 'e', 'f'], [''], ['']], + errors: [] + } + }, + { + description: "Blank line in middle with whitespace", + input: 'a,b,c\r\n \r\nd,e,f', + expected: { + data: [['a', 'b', 'c'], [" "], ['d', 'e', 'f']], + errors: [] + } + }, + { + description: "First field of a line is empty", + input: 'a,b,c\r\n,e,f', + expected: { + data: [['a', 'b', 'c'], ['', 'e', 'f']], + errors: [] + } + }, + { + description: "Last field of a line is empty", + input: 'a,b,\r\nd,e,f', + expected: { + data: [['a', 'b', ''], ['d', 'e', 'f']], + errors: [] + } + }, + { + description: "Other fields are empty", + input: 'a,,c\r\n,,', + expected: { + data: [['a', '', 'c'], ['', '', '']], + errors: [] + } + }, + { + description: "Empty input string", + input: '', + expected: { + data: [], + errors: [{ + "type": "Delimiter", + "code": "UndetectableDelimiter", + "message": "Unable to auto-detect delimiting character; defaulted to ','" + }] + } + }, + { + description: "Input is just the delimiter (2 empty fields)", + input: ',', + expected: { + data: [['', '']], + errors: [] + } + }, + { + description: "Input is just a string (a single field)", + input: 'Abc def', + expected: { + data: [['Abc def']], + errors: [ + { + "type": "Delimiter", + "code": "UndetectableDelimiter", + "message": "Unable to auto-detect delimiting character; defaulted to ','" + } + ] + } + }, + { + description: "Preview 0 rows should default to parsing all", + input: 'a,b,c\r\nd,e,f\r\ng,h,i', + config: { preview: 0 }, + expected: { + data: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i']], + errors: [] + } + }, + { + description: "Preview 1 row", + input: 'a,b,c\r\nd,e,f\r\ng,h,i', + config: { preview: 1 }, + expected: { + data: [['a', 'b', 'c']], + errors: [] + } + }, + { + description: "Preview 2 rows", + input: 'a,b,c\r\nd,e,f\r\ng,h,i', + config: { preview: 2 }, + expected: { + data: [['a', 'b', 'c'], ['d', 'e', 'f']], + errors: [] + } + }, + { + description: "Preview all (3) rows", + input: 'a,b,c\r\nd,e,f\r\ng,h,i', + config: { preview: 3 }, + expected: { + data: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i']], + errors: [] + } + }, + { + description: "Preview more rows than input has", + input: 'a,b,c\r\nd,e,f\r\ng,h,i', + config: { preview: 4 }, + expected: { + data: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i']], + errors: [] + } + }, + { + description: "Preview should count rows, not lines", + input: 'a,b,c\r\nd,e,"f\r\nf",g,h,i', + config: { preview: 2 }, + expected: { + data: [['a', 'b', 'c'], ['d', 'e', 'f\r\nf', 'g', 'h', 'i']], + errors: [] + } + }, + { + description: "Preview with header row", + notes: "Preview is defined to be number of rows of input not including header row", + input: 'a,b,c\r\nd,e,f\r\ng,h,i\r\nj,k,l', + config: { header: true, preview: 2 }, + expected: { + data: [{ "a": "d", "b": "e", "c": "f" }, { "a": "g", "b": "h", "c": "i" }], + errors: [] + } + }, + { + description: "Empty lines", + input: '\na,b,c\n\nd,e,f\n\n', + config: { delimiter: ',' }, + expected: { + data: [[''], ['a', 'b', 'c'], [''], ['d', 'e', 'f'], [''], ['']], + errors: [] + } + }, + { + description: "Skip empty lines", + input: 'a,b,c\n\nd,e,f', + config: { skipEmptyLines: true }, + expected: { + data: [['a', 'b', 'c'], ['d', 'e', 'f']], + errors: [] + } + }, + { + description: "Skip empty lines, with newline at end of input", + input: 'a,b,c\r\n\r\nd,e,f\r\n', + config: { skipEmptyLines: true }, + expected: { + data: [['a', 'b', 'c'], ['d', 'e', 'f']], + errors: [] + } + }, + { + description: "Skip empty lines, with empty input", + input: '', + config: { skipEmptyLines: true }, + expected: { + data: [], + errors: [ + { + "type": "Delimiter", + "code": "UndetectableDelimiter", + "message": "Unable to auto-detect delimiting character; defaulted to ','" + } + ] + } + }, + { + description: "Skip empty lines, with first line only whitespace", + notes: "A line must be absolutely empty to be considered empty", + input: ' \na,b,c', + config: { skipEmptyLines: true, delimiter: ',' }, + expected: { + data: [[" "], ['a', 'b', 'c']], + errors: [] + } + } +]; + +interface UnparserTest { + description: string; + input: any; + expected: string; + notes?: string; + config?: BabyParse.UnparseConfig; +} + +// Tests for Baby.unparse() function (JSON to CSV) +var UNPARSE_TESTS:UnparserTest[] = [ + { + description: "A simple row", + notes: "Comma should be default delimiter", + input: [['A', 'b', 'c']], + expected: 'A,b,c' + }, + { + description: "Two rows", + input: [['A', 'b', 'c'], ['d', 'E', 'f']], + expected: 'A,b,c\r\nd,E,f' + }, + { + description: "Data with quotes", + input: [['a', '"b"', 'c'], ['"d"', 'e', 'f']], + expected: 'a,"""b""",c\r\n"""d""",e,f' + }, + { + description: "Data with newlines", + input: [['a', 'b\nb', 'c'], ['d', 'e', 'f\r\nf']], + expected: 'a,"b\nb",c\r\nd,e,"f\r\nf"' + }, + { + description: "Array of objects (header row)", + input: [{ "Col1": "a", "Col2": "b", "Col3": "c" }, { "Col1": "d", "Col2": "e", "Col3": "f" }], + expected: 'Col1,Col2,Col3\r\na,b,c\r\nd,e,f' + }, + { + description: "With header row, missing a field in a row", + input: [{ "Col1": "a", "Col2": "b", "Col3": "c" }, { "Col1": "d", "Col3": "f" }], + expected: 'Col1,Col2,Col3\r\na,b,c\r\nd,,f' + }, + { + description: "With header row, with extra field in a row", + notes: "Extra field should be ignored; first object in array dictates header row", + input: [{ "Col1": "a", "Col2": "b", "Col3": "c" }, { "Col1": "d", "Col2": "e", "Extra": "g", "Col3": "f" }], + expected: 'Col1,Col2,Col3\r\na,b,c\r\nd,e,f' + }, + { + description: "Specifying column names and data separately", + input: { fields: ["Col1", "Col2", "Col3"], data: [["a", "b", "c"], ["d", "e", "f"]] }, + expected: 'Col1,Col2,Col3\r\na,b,c\r\nd,e,f' + }, + { + description: "Specifying column names only (no data)", + notes: "Baby should add a data property that is an empty array to prevent errors (no copy is made)", + input: { fields: ["Col1", "Col2", "Col3"] }, + expected: 'Col1,Col2,Col3' + }, + { + description: "Specifying data only (no field names), properly", + notes: "An array of arrays, even if just a single row.
Baby should add empty fields property to prevent errors.", + input: { data: [["a", "b", "c"]] }, + expected: 'a,b,c' + }, + { + description: "Custom delimiter (semicolon)", + input: [['A', 'b', 'c'], ['d', 'e', 'f']], + config: { delimiter: ';' }, + expected: 'A;b;c\r\nd;e;f' + }, + { + description: "Custom delimiter (tab)", + input: [['Ab', 'cd', 'ef'], ['g', 'h', 'ij']], + config: { delimiter: '\t' }, + expected: 'Ab\tcd\tef\r\ng\th\tij' + }, + { + description: "Custom delimiter (ASCII 30)", + input: [['a', 'b', 'c'], ['d', 'e', 'f']], + config: { delimiter: RECORD_SEP }, + expected: 'a' + RECORD_SEP + 'b' + RECORD_SEP + 'c\r\nd' + RECORD_SEP + 'e' + RECORD_SEP + 'f' + }, + { + description: "Bad delimiter (\\n)", + notes: "Should default to comma", + input: [['a', 'b', 'c'], ['d', 'e', 'f']], + config: { delimiter: '\n' }, + expected: 'a,b,c\r\nd,e,f' + }, + { + description: "Custom line ending (\\r)", + input: [['a', 'b', 'c'], ['d', 'e', 'f']], + config: { newline: '\r' }, + expected: 'a,b,c\rd,e,f' + }, + { + description: "Custom line ending (\\n)", + input: [['a', 'b', 'c'], ['d', 'e', 'f']], + config: { newline: '\n' }, + expected: 'a,b,c\nd,e,f' + }, + { + description: "Custom, but strange, line ending ($)", + input: [['a', 'b', 'c'], ['d', 'e', 'f']], + config: { newline: '$' }, + expected: 'a,b,c$d,e,f' + }, + { + description: "Force quotes around all fields", + input: [['a', 'b', 'c'], ['d', 'e', 'f']], + config: { quotes: true }, + expected: '"a","b","c"\r\n"d","e","f"' + }, + { + description: "Force quotes around all fields (with header row)", + input: [{ "Col1": "a", "Col2": "b", "Col3": "c" }, { "Col1": "d", "Col2": "e", "Col3": "f" }], + config: { quotes: true }, + expected: '"Col1","Col2","Col3"\r\n"a","b","c"\r\n"d","e","f"' + }, + { + description: "Force quotes around certain fields only", + input: [['a', 'b', 'c'], ['d', 'e', 'f']], + config: { quotes: [true, false, true] }, + expected: '"a",b,"c"\r\n"d",e,"f"' + }, + { + description: "Force quotes around certain fields only (with header row)", + input: [{ "Col1": "a", "Col2": "b", "Col3": "c" }, { "Col1": "d", "Col2": "e", "Col3": "f" }], + config: { quotes: [true, false, true] }, + expected: '"Col1",Col2,"Col3"\r\n"a",b,"c"\r\n"d",e,"f"' + }, + { + description: "Empty input", + input: [], + expected: '' + }, + { + description: "Mismatched field counts in rows", + input: [['a', 'b', 'c'], ['d', 'e'], ['f']], + expected: 'a,b,c\r\nd,e\r\nf' + }, + { + description: "JSON null is treated as empty value", + input: [{ "Col1": "a", "Col2": null, "Col3": "c" }], + expected: 'Col1,Col2,Col3\r\na,,c' + } +]; + +var passCount = 0; +var failCount = 0; +var testCount = 0; + + +// Next, run tests and render results! +runCoreParserTests(); +runParseTests(); +runUnparseTests(); +console.log('passCount=' + passCount + ', failCount=' + failCount); + + +// Executes all tests in CORE_PARSER_TESTS from test-cases.js +// and renders results in the table. +function runCoreParserTests(): void { + for (var i = 0; i < CORE_PARSER_TESTS.length; i++) { + var test = CORE_PARSER_TESTS[i]; + var passed = runTest(test); + if (passed) + passCount++; + else + failCount++; + } + + function runTest(test: ParserTest): boolean { + var babyParser = new Baby.Parser(test.config); + var actual = babyParser.parse(test.input); + var results = compare(actual.data, actual.errors, test.expected); + displayResults(test, actual, results); + return results.data.passed && results.errors.passed; + } +} + + +// Executes all tests in PARSE_TESTS from test-cases.js +// and renders results in the table. +function runParseTests(): void { + for (var i = 0; i < PARSE_TESTS.length; i++) { + var test = PARSE_TESTS[i]; + var passed = runTest(test); + if (passed) + passCount++; + else + failCount++; + } + + function runTest(test: ParserTest): boolean { + var actual = Baby.parse(test.input, test.config); + var results = compare(actual.data, actual.errors, test.expected); + displayResults(test, actual, results); + return results.data.passed && results.errors.passed; + } +} + +function displayResults( + test: ParserTest, + actual: BabyParse.ParseResult, + results: ParserTestCompareResult): void { + var testId = testCount++; + + var testDescription = (test.description || ""); + + var tr = testId + + ',' + testDescription + + ',' + results.data.passed + + ',' + results.errors.passed + // + '\t' + results.data + // + '\t' + results.errors + // + '\t' + JSON.stringify(test.config, null, 2) + // + '\t' + revealChars(test.input) + // + '\t' + JSON.stringify(test.expected.data, null, 4) + // + '\terrors: ' + JSON.stringify(test.expected.errors, null, 4) + // + '\t' + JSON.stringify(actual.data, null, 4) + // + '\terrors: ' + JSON.stringify(actual.errors, null, 4) + ; + console.log(tr); + +} + + +function compare(actualData: any[], actualErrors: any[], expected: ParserTestExpectedResult): ParserTestCompareResult { + var data = compareData(actualData, expected.data); + var errors = compareErrors(actualErrors, expected.errors); + + return { + data: data, + errors: errors + }; + + + function compareData(actual: any[], expected: any[]): ParserTestPassFail { + var passed = true; + + if (actual.length != expected.length) + passed = false; + else { + // The order is important, so we go through manually before using stringify to check everything else + for (var row = 0; row < expected.length; row++) { + if (actual[row].length != expected[row].length) { + passed = false; + break; + } + + for (var col = 0; col < expected[row].length; col++) { + var expectedVal = expected[row][col]; + var actualVal = actual[row][col]; + + if (actualVal !== expectedVal) { + passed = false; + break; + } + } + } + } + + if (passed) // final check will catch any other differences + passed = JSON.stringify(actual) == JSON.stringify(expected); + + // We pass back an object right now, even though it only contains + // one value, because we might add details to the test results later + // (same with compareErrors below) + return { + passed: passed + }; + } + + + function compareErrors(actual: any[], expected: any[]): ParserTestPassFail { + var passed = JSON.stringify(actual) == JSON.stringify(expected); + + return { + passed: passed + }; + } +} + + + + + +// Executes all tests in UNPARSE_TESTS from test-cases.js +// and renders results in the table. +function runUnparseTests() { + for (var i = 0; i < UNPARSE_TESTS.length; i++) { + var test = UNPARSE_TESTS[i]; + var passed = runTest(test); + if (passed) + passCount++; + else + failCount++; + } + + function runTest(test:UnparserTest) { + var actual:string; + + try { + actual = Baby.unparse(test.input, test.config); + } + catch (e) { + if (e instanceof Error) { + throw e; + } + actual = e; + } + + var testId = testCount++; + var results = compare(actual, test.expected); + + var testDescription = (test.description || ""); + + var tr = testId + + ',' + testDescription + + ',' + results.passed + // + '\t' + JSON.stringify(test.config, null, 2) + // + '\t' + JSON.stringify(test.input, null, 4) + // + '\t' + revealChars(test.expected) + // + '\t' + revealChars(actual) + ; + console.log(tr); + + return results.passed; + } + + + function compare(actual:string, expected:string): { passed: boolean } { + return { + passed: actual === expected + }; + } +} + +// Reveals some hidden, whitespace, or invisible characters +function revealChars(txt:string) { + // Make spaces and tabs more obvious when glancing + // txt = txt.replace(/( |\t)/ig, '$1'); + // txt = txt.replace(/(\r\n|\n\r|\r|\n)/ig, '$1$1'); + // + // // Make UNIT_SEP and RECORD_SEP characters visible + // txt = txt.replace(/(\u001e|\u001f)/ig, '$1$1'); + // + // // Now make the whitespace and invisible characters + // // within the spans actually appear on the page + // txt = txt.replace(/">\r\n<\/span>/ig, '">\\r\\n'); + // txt = txt.replace(/">\n\r<\/span>/ig, '">\\n\\r'); + // txt = txt.replace(/">\r<\/span>/ig, '">\\r'); + // txt = txt.replace(/">\n<\/span>/ig, '">\\n'); + // txt = txt.replace(/">\u001e<\/span>/ig, '">\\u001e'); + // txt = txt.replace(/">\u001f<\/span>/ig, '">\\u001f'); + // + return txt; +} + +/** + * Parsing + */ +var res = Baby.parse("3,3,3"); + +Baby.parse("3,3,3", { + delimiter: ';', + comments: false, + + step: function(results, p) { + p.abort(); + results.data.length; + } +}); + +/** + * Unparsing + */ +Baby.unparse([{ a: 1, b: 1, c: 1 }]); +Baby.unparse([[1, 2, 3], [4, 5, 6]]); +Baby.unparse({ + fields: ["3"], + data: [] +}); + + + +/** + * Properties + */ +Baby.SCRIPT_PATH; +Baby.LocalChunkSize; + +/** + * Parser + */ +var parser = new Baby.Parser({}) +parser.getCharIndex(); +parser.abort(); +parser.parse(""); diff --git a/babyparse/babyparse.d.ts b/babyparse/babyparse.d.ts new file mode 100644 index 000000000..b8c61c9cb --- /dev/null +++ b/babyparse/babyparse.d.ts @@ -0,0 +1,135 @@ +// Type definitions for babyparse +// Project: https://github.com/Rich-Harris/BabyParse +// Definitions by: Charles Parker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module BabyParse { + interface Static { + /** + * Parse a csv string or a csv file + */ + parse(csvString: string, config?: ParseConfig): ParseResult; + + /** + * Unparses javascript data objects and returns a csv string + */ + unparse(data: Array, config?: UnparseConfig): string; + + unparse(data: Array>, config?: UnparseConfig): string; + + unparse(data: UnparseObject, config?: UnparseConfig): string; + + /** + * Read-Only Properties + */ + // An array of characters that are not allowed as delimiters. + BAD_DELIMETERS: Array; + + // The true delimiter. Invisible. ASCII code 30. Should be doing the job we strangely rely upon commas and tabs for. + RECORD_SEP: string; + + // Also sometimes used as a delimiting character. ASCII code 31. + UNIT_SEP: string; + + // Whether or not the browser supports HTML5 Web Workers. If false, worker: true will have no effect. + WORKERS_SUPPORTED: boolean; + + // The relative path to Papa Parse. This is automatically detected when Papa Parse is loaded synchronously. + SCRIPT_PATH: string; + + /** + * Configurable Properties + */ + // The size in bytes of each file chunk. Used when streaming files obtained from the DOM that exist on the local computer. Default 10 MB. + LocalChunkSize: string; + + // Same as LocalChunkSize, but for downloading files from remote locations. Default 5 MB. + RemoteChunkSize: string; + + // The delimiter used when it is left unspecified and cannot be detected automatically. Default is comma. + DefaultDelimiter: string; + + /** + * On Papa there are actually more classes exposed + * but none of them are officially documented + * Since we can interact with the Parser from one of the callbacks + * I have included the API for this class. + */ + Parser: ParserConstructor; + } + interface ParseConfig { + delimiter?: string; // default: "" + newline?: string; // default: "" + header?: boolean; // default: false + dynamicTyping?: boolean; // default: false + preview?: number; // default: 0 + encoding?: string; // default: "" + worker?: boolean; // default: false + comments?: boolean; // default: false + download?: boolean; // default: false + skipEmptyLines?: boolean; // default: false + fastMode?: boolean; // default: undefined + + // Callbacks + step?(results: ParseResult, parser: Parser): void; // default: undefined + complete?(results: ParseResult): void; // default: undefined + } + + interface UnparseConfig { + quotes?: boolean|boolean[]; // default: false + delimiter?: string; // default: "," + newline?: string; // default: "\r\n" + } + + interface UnparseObject { + fields: Array; + data: string | Array; + } + + interface ParseError { + type: string; // A generalization of the error + code: string; // Standardized error code + message: string; // Human-readable details + row: number; // Row index of parsed data where error is + } + + interface ParseMeta { + delimiter: string; // Delimiter used + linebreak: string; // Line break sequence used + aborted: boolean; // Whether process was aborted + fields: Array; // Array of field names + truncated: boolean; // Whether preview consumed all input + } + + /** + * @interface ParseResult + * + * data: is an array of rows. If header is false, rows are arrays; otherwise they are objects of data keyed by the field name. + * errors: is an array of errors + * meta: contains extra information about the parse, such as delimiter used, the newline sequence, whether the process was aborted, etc. Properties in this object are not guaranteed to exist in all situations + */ + interface ParseResult { + data: Array; + errors: Array; + meta: ParseMeta; + } + interface ParserConstructor { new (config: ParseConfig): Parser; } + interface Parser { + // Parses the input + parse(input: string): any; + + // Sets the abort flag + abort(): void; + + // Gets the cursor position + getCharIndex(): number; + } + +} + +declare var Baby:BabyParse.Static; + +declare module "babyparse"{ + var Baby:BabyParse.Static; + export = Baby; +} \ No newline at end of file diff --git a/cordova-plugin-insomnia/cordova-plugin-insomnia-tests.ts b/cordova-plugin-insomnia/cordova-plugin-insomnia-tests.ts new file mode 100644 index 000000000..2d7f04a10 --- /dev/null +++ b/cordova-plugin-insomnia/cordova-plugin-insomnia-tests.ts @@ -0,0 +1,11 @@ +/// +/// + +window.plugins.insomnia.allowSleepAgain( + () => { console.log("success"); }, + () => { console.log("fail"); } +); +window.plugins.insomnia.keepAwake( + () => { console.log("success"); }, + () => { console.log("fail"); } +); diff --git a/cordova-plugin-insomnia/cordova-plugin-insomnia.d.ts b/cordova-plugin-insomnia/cordova-plugin-insomnia.d.ts new file mode 100644 index 000000000..c7f567a56 --- /dev/null +++ b/cordova-plugin-insomnia/cordova-plugin-insomnia.d.ts @@ -0,0 +1,24 @@ +// Type definitions for Insomnia-PhoneGap-Plugin v4.0.1 +// Project: https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin/ +// Definitions by: Markus Wagner +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface Plugins { + insomnia: InsomniaPlugin.Insomnia; +} + +declare module InsomniaPlugin { + + export interface Insomnia { + + /** + * Prevent the screen of the mobile device from falling asleep. + */ + keepAwake(success?: () => any, fail?: () => any): void; + + /** + * After making your app practically a zombie, you can allow it to sleep again by calling allowSleepAgain. + */ + allowSleepAgain(success?: () => any, fail?: () => any): void; + } +} \ No newline at end of file diff --git a/crossfilter/crossfilter-tests.ts b/crossfilter/crossfilter-tests.ts index 745ed3aa4..fb80ddd9b 100644 --- a/crossfilter/crossfilter-tests.ts +++ b/crossfilter/crossfilter-tests.ts @@ -24,6 +24,11 @@ var payments = crossfilter([ {date: "2011-11-14T17:29:52Z", quantity: 1, total: 200, tip: 100, type: "visa"} ]); +var total_payments : number = payments.groupAll().reduce( + function(p,v) { return p+=v.total; }, + function(p,v) { return p-=v.total; }, + function() { return 0; } ).value(); + var paymentsByTotal = payments.dimension((d) => d.total); // Filters diff --git a/crossfilter/crossfilter.d.ts b/crossfilter/crossfilter.d.ts index c98d20867..9e506aa43 100644 --- a/crossfilter/crossfilter.d.ts +++ b/crossfilter/crossfilter.d.ts @@ -58,12 +58,12 @@ declare module CrossFilter { (array: T[], lo: number, hi: number): T[]; } - export interface GroupAll { - reduce(add: (p: TValue, v: T) => TValue, remove: (p: TValue, v: T) => TValue, initial: () => TValue): GroupAll; - reduceCount(): GroupAll; - reduceSum(value: Selector): GroupAll; - dispose(): GroupAll; - value(): T; + export interface GroupAll { + reduce(add: (p: TValue, v: T) => TValue, remove: (p: TValue, v: T) => TValue, initial: () => TValue): GroupAll; + reduceCount(): GroupAll; + reduceSum(value: Selector): GroupAll; + dispose(): GroupAll; + value(): TValue; } export interface Grouping { @@ -87,7 +87,8 @@ declare module CrossFilter { add(records: T[]): CrossFilter; remove(): CrossFilter; size(): number; - groupAll(): GroupAll; + GroupAll(): GroupAll; + groupAll(): GroupAll; dimension(value: (data: T) => TDimension): Dimension; } @@ -103,8 +104,9 @@ declare module CrossFilter { bottom(k: number): T[]; dispose(): void; group(): Group; - group(groupValue: (data: TDimension) => TGroup): Group; - groupAll(): GroupAll; + group(groupValue: (data: TDimension) => TGroup): Group; + groupAll(): GroupAll; + groupAll(): GroupAll; } } diff --git a/fromnow/fromnow-tests.ts b/fromnow/fromnow-tests.ts new file mode 100644 index 000000000..b95a23640 --- /dev/null +++ b/fromnow/fromnow-tests.ts @@ -0,0 +1,25 @@ +/// + +import fromnow = require( 'fromnow' ); + +function dateOnly() { + fromnow( '2015-12-31' ); +} + +function maxChunks() { + fromnow( '2015-12-31', { + maxChunks: 12 + }); +} + +function useAgo() { + fromnow( '2015-12-31', { + useAgo: true + }); +} + +function useAnd() { + fromnow( '2015-12-31', { + useAnd: true + }); +} \ No newline at end of file diff --git a/fromnow/fromnow.d.ts b/fromnow/fromnow.d.ts new file mode 100644 index 000000000..afb5235fa --- /dev/null +++ b/fromnow/fromnow.d.ts @@ -0,0 +1,28 @@ +// Type definitions for fromnow v2.0.0 +// Project: https://github.com/lukeed/fromNow +// Definitions by: Martin Bukovics +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module FromNow { + interface FromNowOpts { + maxChunks?: number, + useAgo?: boolean, + useAnd?: boolean + } + export interface FromNowStatic { + /** + * Get readable time differences from now vs past or future dates. + * @param {string} date + * @param {object} [opts] + * @param {number} [opts.maxChucks=10] + * @param {boolean} [opts.useAgo=false] + * @param {boolean} [opts.useAnd=false] + */ + (date: string, opts?: FromNowOpts): string + } +} + +declare module 'fromnow' { + var FromNow: FromNow.FromNowStatic; + export = FromNow; +} \ No newline at end of file diff --git a/github-electron/github-electron-main-tests.ts b/github-electron/github-electron-main-tests.ts index 5d3060e4b..b2343da39 100644 --- a/github-electron/github-electron-main-tests.ts +++ b/github-electron/github-electron-main-tests.ts @@ -227,6 +227,10 @@ app.commandLine.appendSwitch('vmodule', 'console=0'); autoUpdater.setFeedURL('http://mycompany.com/myapp/latest?version=' + app.getVersion()); +autoUpdater.checkForUpdates(); + +autoUpdater.quitAndInstall(); + // browser-window // https://github.com/atom/electron/blob/master/docs/api/browser-window.md diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts index 418ef71fc..f7bab797f 100644 --- a/github-electron/github-electron.d.ts +++ b/github-electron/github-electron.d.ts @@ -1186,6 +1186,11 @@ declare module Electron { * before using this API */ checkForUpdates(): any; + /** + * Restarts the app and installs the update after it has been downloaded. + * It should only be called after update-downloaded has been emitted. + */ + quitAndInstall(): void; } module Dialog { diff --git a/graphene-pk11/graphene-pk11-tests.ts b/graphene-pk11/graphene-pk11-tests.ts new file mode 100644 index 000000000..624e0c2f1 --- /dev/null +++ b/graphene-pk11/graphene-pk11-tests.ts @@ -0,0 +1,29 @@ +/// + +import * as graphene from "graphene-pk11"; + +// Example of Hashing from README.MD +let Module = graphene.Module; + +let lib = "/usr/local/lib/softhsm/libsofthsm2.so"; + +let mod = Module.load(lib, "SoftHSM"); +mod.initialize(); + +let slot = mod.getSlots(0); +if (slot.flags & graphene.SlotFlag.TOKEN_PRESENT) { + let session = slot.open(); + + let digest = session.createDigest("sha1"); + digest.update("simple text 1"); + digest.update("simple text 2"); + let hash = digest.final(); + + console.log("Hash SHA1:", hash.toString("hex")); // Hash SHA1: e1dc1e52e9779cd69679b3e0af87d2e288190d34 + session.close(); +} +else { + console.error("Slot is not initialized"); +} + +mod.finalize(); \ No newline at end of file diff --git a/graphene-pk11/graphene-pk11.d.ts b/graphene-pk11/graphene-pk11.d.ts new file mode 100644 index 000000000..4453a921f --- /dev/null +++ b/graphene-pk11/graphene-pk11.d.ts @@ -0,0 +1,2719 @@ +// Type definitions for graphene-pk11 v2.0.0 +// Project: https://github.com/PeculiarVentures/graphene +// Definitions by: Stepan Miroshin +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +/** + * A simple layer for interacting with PKCS #11 / PKCS11 / CryptoKI for Node + * v2.0.0 + */ + +declare module "graphene-pk11" { + + type Callback = (err: Error, rv: number) => void; + type CK_PTR = Buffer; + + class Pkcs11 { + lib: any; + /** + * load a library with PKCS11 interface + * @param {string} libFile path to PKCS11 library + */ + constructor(libFile: string); + protected callFunction(funcName: string, args: any[]): number; + /** + * C_Initialize initializes the Cryptoki library. + * @param pInitArgs if this is not NULL_PTR, it gets + * cast to CK_C_INITIALIZE_ARGS_PTR + * and dereferenced + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_Initialize(pInitArgs?: CK_PTR): number; + C_Initialize(pInitArgs: CK_PTR, cllback: Callback): void; + /** + * C_Finalize indicates that an application is done with the Cryptoki library. + * @param pReserved reserved. Should be NULL_PTR + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_Finalize(pReserved?: CK_PTR): number; + C_Finalize(pReserved: CK_PTR, callback: Callback): void; + /** + * C_GetInfo returns general information about Cryptoki. + * @param pInfo location that receives information + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_GetInfo(pInfo: CK_PTR): number; + C_GetInfo(pInfo: CK_PTR, callback: Callback): void; + /** + * C_GetSlotList obtains a list of slots in the system. + * @param {boolean} tokenPresent only slots with tokens? + * @param pSlotList receives array of slot IDs + * @param pulCount receives number of slots + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_GetSlotList(tokenPresent: boolean, pSlotList: CK_PTR, pulCount: CK_PTR): number; + C_GetSlotList(tokenPresent: boolean, pSlotList: CK_PTR, pulCount: CK_PTR, callback: Callback): void; + /** + * C_GetSlotInfo obtains information about a particular slot in + * the system. + * @param {number} slotID the ID of the slot + * @param {Buffer} pInfo receives the slot information + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_GetSlotInfo(slotID: number, pInfo: CK_PTR): number; + C_GetSlotInfo(slotID: number, pInfo: CK_PTR, callback: Callback): void; + /** + * C_GetTokenInfo obtains information about a particular token + * in the system. + * @param {number} slotID ID of the token's slot + * @param {Buffer} pInfo receives the token information + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_GetTokenInfo(slotID: number, pInfo: Buffer): number; + C_GetTokenInfo(slotID: number, pInfo: Buffer, callback: Callback): void; + /** + * C_GetMechanismList obtains a list of mechanism types + * supported by a token. + * @param {number} slotID ID of the token's slot + * @param {number} pMechanismList gets mech. array + * @param {number} pulCount gets # of mechs + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_GetMechanismList(slotID: number, pMechanismList: Buffer, pulCount: Buffer): number; + C_GetMechanismList(slotID: number, pMechanismList: Buffer, pulCount: Buffer, callback: Callback): void; + /** C_GetMechanismInfo obtains information about a particular + * mechanism possibly supported by a token. + * @param {number} slotID ID of the token's slot + * @param {number} type type of mechanism + * @param {Buffer} pInfo receives mechanism info + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_GetMechanismInfo(slotID: number, type: number, pInfo: Buffer): number; + C_GetMechanismInfo(slotID: number, type: number, pInfo: Buffer, callback: Callback): void; + /** + * C_InitToken initializes a token. + * @param {number} slotID ID of the token's slot + * @param {Buffer} pPin the SO's initial PIN + * @param {number} ulPinLen length in bytes of the PIN + * @param {number} pLabel 32-byte token label (blank padded) + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_InitToken(slotID: number, pPin: Buffer, ulPinLen: number, pLabel: Buffer): number; + C_InitToken(slotID: number, pPin: Buffer, ulPinLen: number, pLabel: Buffer, callback: Callback): void; + /** + * C_InitPIN initializes the normal user's PIN. + * @param {number} hSession the session's handle + * @param {Buffer} pPin the normal user's PIN + * @param {number} ulPinLen length in bytes of the PIN + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_InitPIN(hSession: number, pPin: Buffer, ulPinLen: number): number; + C_InitPIN(hSession: number, pPin: Buffer, ulPinLen: number, callback: Callback): void; + /** + * C_SetPIN modifies the PIN of the user who is logged in. + * @param {number} hSession the session's handle + * @param {Buffer} pOldPin the old PIN + * @param {number} ulOldLen length of the old PIN + * @param {Buffer} pNewPin the new PIN + * @param {number} ulNewLen length of the new PIN + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_SetPIN(hSession: any, pOldPin: Buffer, ulOldLen: number, pNewPin: Buffer, ulNewLen: number): number; + C_SetPIN(hSession: any, pOldPin: Buffer, ulOldLen: number, pNewPin: Buffer, ulNewLen: number, callback: Callback): void; + /** + * C_OpenSession opens a session between an application and a + * token. + * @param {number} slotID ID of the token's slot + * @param {number} flags from CK_SESSION_INFO + * @param {Buffer} pApplication passed to callback + * @param {Buffer} Notify callback function + * @param {Buffer} phSession gets session handle + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_OpenSession(slotID: number, flags: number, pApplication?: Buffer, notify?: Buffer, phSession?: Buffer): number; + C_OpenSession(slotID: number, flags: number, pApplication: Buffer, notify: Buffer, phSession: Buffer, callback: Callback): void; + /** + * C_CloseSession closes a session between an application and a token. + * @param {number} hSession the session's handle + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_CloseSession(hSession: number): number; + C_CloseSession(hSession: number, callback: Callback): void; + /** + * C_CloseAllSessions closes all sessions with a token. + * @param {number} slotID ID of the token's slot + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_CloseAllSessions(slotID: number): number; + C_CloseAllSessions(slotID: number, callback: Callback): void; + /** + * C_GetSessionInfo obtains information about the session. + * @param {number} hSession the session's handle + * @param {Buffer} pInfo receives session info + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_GetSessionInfo(hSession: number, pInfo: Buffer): number; + C_GetSessionInfo(hSession: number, pInfo: Buffer, callback: Callback): void; + /** + * C_GetOperationState obtains the state of the cryptographic operation in a session. + * @param {number} hSession the session's handle + * @param {Buffer} pOperationState gets state + * @param {Buffer} pulOperationStateLen gets state length + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_GetOperationState(hSession: number, pOperationState: Buffer, pulOperationStateLen: Buffer): number; + C_GetOperationState(hSession: number, pOperationState: Buffer, pulOperationStateLen: Buffer, callback: Callback): void; + /** + * C_SetOperationState restores the state of the cryptographic operation in a session. + * @param {number} hSession the session's handle + * @param {Buffer} pOperationState holds state + * @param {number} ulOperationStateLen holds holds state length + * @param {number} hEncryptionKey en/decryption key + * @param {number} hAuthenticationKey sign/verify key + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_SetOperationState(hSession: number, pOperationState: Buffer, ulOperationStateLen: number, hEncryptionKey: number, hAuthenticationKey: number): number; + C_SetOperationState(hSession: number, pOperationState: Buffer, ulOperationStateLen: number, hEncryptionKey: number, hAuthenticationKey: number, callback: Callback): void; + /** + * C_Login logs a user into a token. + * @param {number} hSession the session's handle + * @param {number} userType the user type + * @param {Buffer} pPin the user's PIN + * @param {number} ulPinLen the length of the PIN + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_Login(hSession: number, userType: number, pPin: Buffer, ulPinLen: number): number; + C_Login(hSession: number, userType: number, pPin: Buffer, ulPinLen: number, callback: Callback): void; + /** + * C_Logout logs a user out from a token. + * @param {number} hSession the session's handle + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_Logout(hSession: number): number; + C_Logout(hSession: number, callback: Callback): void; + /** + * C_CreateObject creates a new object. + * @param {number} hSession the session's handle + * @param {Buffer} pTemplate the object's template + * @param {number} ulCount attributes in template + * @param {Buffer} phObject gets new object's handle + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_CreateObject(hSession: number, pTemplate: Buffer, ulCount: number, phObject: Buffer): number; + C_CreateObject(hSession: number, pTemplate: Buffer, ulCount: number, phObject: Buffer, callback: Callback): void; + /** + * C_CopyObject copies an object, creating a new object for the copy. + * @param {number} hSession the session's handle + * @param {number} hObject the object's handle + * @param {Buffer} pTemplate template for new object + * @param {number} ulCount attributes in template + * @param {Buffer} phNewObject receives handle of copy + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_CopyObject(hSession: number, hObject: number, pTemplate: Buffer, ulCount: number, phNewObject: Buffer): number; + C_CopyObject(hSession: number, hObject: number, pTemplate: Buffer, ulCount: number, phNewObject: Buffer, callback: Callback): void; + /** + * C_DestroyObject destroys an object. + * @param {number} hSession the session's handle + * @param {number} hObject the object's handle + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_DestroyObject(hSession: number, hObject: number): number; + C_DestroyObject(hSession: number, hObject: number, callback: Callback): void; + /** + * C_GetObjectSize gets the size of an object in bytes. + * @param {number} hSession the session's handle + * @param {number} hObject the object's handle + * @param {Buffer} pulSize receives size of object + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_GetObjectSize(hSession: number, hObject: number, pulSize: Buffer): number; + C_GetObjectSize(hSession: number, hObject: number, pulSize: Buffer, callback: Callback): void; + /** + * C_GetAttributeValue obtains the value of one or more object attributes. + * @param {number} hSession the session's handle + * @param {number} hObject the object's handle + * @param {Buffer} pTemplate specifies attrs; gets vals + * @param {number} ulCount attributes in template + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_GetAttributeValue(hSession: number, hObject: number, pTemplate: Buffer, ulCount: number): number; + C_GetAttributeValue(hSession: number, hObject: number, pTemplate: Buffer, ulCount: number, callback: Callback): void; + /** + * C_SetAttributeValue modifies the value of one or more object attributes + * @param {number} hSession the session's handle + * @param {number} hObject the object's handle + * @param {Buffer} pTemplate specifies attrs and values + * @param {number} ulCount attributes in template + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_SetAttributeValue(hSession: number, hObject: number, pTemplate: Buffer, ulCount: number): number; + C_SetAttributeValue(hSession: number, hObject: number, pTemplate: Buffer, ulCount: number, callback: Callback): void; + /** + * C_FindObjectsInit initializes a search for token and session + * objects that match a template. + * @param {number} hSession the session's handle + * @param {Buffer} pTemplate attribute values to match + * @param {number} ulCount attrs in search template + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_FindObjectsInit(hSession: number, pTemplate: Buffer, ulCount: number): number; + C_FindObjectsInit(hSession: number, pTemplate: Buffer, ulCount: number, callback: Callback): void; + /** + * C_FindObjects continues a search for token and session + * objects that match a template, obtaining additional object + * handles. + * @param {number} hSession the session's handle + * @param {Buffer} phObject gets obj. handles + * @param {number} ulMaxObjectCount max handles to get + * @param {Buffer} pulObjectCount actual # returned + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_FindObjects(hSession: number, phObject: Buffer, ulMaxObjectCount: number, pulObjectCount: Buffer): number; + C_FindObjects(hSession: number, phObject: Buffer, ulMaxObjectCount: number, pulObjectCount: Buffer, callback: Callback): void; + /** + * C_FindObjectsFinal finishes a search for token and session objects. + * @param {number} hSession the session's handle + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_FindObjectsFinal(hSession: number): number; + C_FindObjectsFinal(hSession: number, callback: Callback): void; + /** + * C_EncryptInit initializes an encryption operation. + * @param {number} hSession the session's handle + * @param {Buffer} pMechanism the encryption mechanism + * @param {number} hKey handle of encryption key + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_EncryptInit(hSession: number, pMechanism: Buffer, hKey: number): number; + C_EncryptInit(hSession: number, pMechanism: Buffer, hKey: number, callback: Callback): void; + /** + * C_Encrypt encrypts single-part data. + * @param {number} hSession the session's handle + * @param {Buffer} pData the plaintext data + * @param {number} ulDataLen bytes of plaintext + * @param {Buffer} pEncryptedData gets ciphertext + * @param {Buffer} pulEncryptedDataLen gets c-text size + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_Encrypt(hSession: number, pData: Buffer, ulDataLen: number, pEncryptedData: Buffer, pulEncryptedDataLen: Buffer): number; + C_Encrypt(hSession: number, pData: Buffer, ulDataLen: number, pEncryptedData: Buffer, pulEncryptedDataLen: Buffer, callback: Callback): void; + /** + * C_EncryptUpdate continues a multiple-part encryption operation. + * @param {number} hSession the session's handle + * @param {Buffer} pPart the plaintext data + * @param {number} ulPartLen plaintext data len + * @param {Buffer} pEncryptedPart gets ciphertext + * @param {Buffer} pulEncryptedPartLen gets c-text size + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_EncryptUpdate(hSession: number, pPart: Buffer, ulPartLen: number, pEncryptedPart: Buffer, pulEncryptedPartLen: Buffer): number; + C_EncryptUpdate(hSession: number, pPart: Buffer, ulPartLen: number, pEncryptedPart: Buffer, pulEncryptedPartLen: Buffer, callback: Callback): void; + /** + * C_EncryptFinal finishes a multiple-part encryption operation. + * @param {number} hSession the session's handle + * @param {Buffer} pLastEncryptedPart last c-text + * @param {Buffer} pulLastEncryptedPartLen gets last size + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_EncryptFinal(hSession: number, pLastEncryptedPart: Buffer, pulLastEncryptedPartLen: Buffer): number; + C_EncryptFinal(hSession: number, pLastEncryptedPart: Buffer, pulLastEncryptedPartLen: Buffer, callback: Callback): void; + /** + * C_DecryptInit initializes a decryption operation. + * @param {number} hSession the session's handle + * @param {Buffer} pMechanism the decryption mechanism + * @param {number} hKey handle of decryption key + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_DecryptInit(hSession: number, pMechanism: Buffer, hKey: number): any; + C_DecryptInit(hSession: number, pMechanism: Buffer, hKey: number, callback: Callback): void; + /** + * C_Decrypt decrypts encrypted data in a single part. + * @param {number} hSession the session's handle + * @param {Buffer} pEncryptedData ciphertext + * @param {number} ulEncryptedDataLen ciphertext length + * @param {Buffer} pData gets plaintext + * @param {number} pulDataLen gets p-text size + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_Decrypt(hSession: number, pEncryptedData: Buffer, ulEncryptedDataLen: number, pData: Buffer, pulDataLen: Buffer): number; + C_Decrypt(hSession: number, pEncryptedData: Buffer, ulEncryptedDataLen: number, pData: Buffer, pulDataLen: Buffer, callback: Callback): void; + /** + * C_DecryptUpdate continues a multiple-part decryption operation. + * @param {number} hSession the session's handle + * @param {Buffer} pEncryptedPart encrypted data + * @param {number} ulEncryptedPartLen input length + * @param {Buffer} pPart gets plaintext + * @param {Buffer} pulPartLen p-text size + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_DecryptUpdate(hSession: number, pEncryptedPart: Buffer, ulEncryptedPartLen: number, pPart: Buffer, pulPartLen: Buffer): number; + C_DecryptUpdate(hSession: number, pEncryptedPart: Buffer, ulEncryptedPartLen: number, pPart: Buffer, pulPartLen: Buffer, callback: Callback): void; + /** + * C_DecryptFinal finishes a multiple-part decryption operation. + * @param {number} hSession the session's handle + * @param {Buffer} pLastPart gets plaintext + * @param {Buffer} pulLastPartLen p-text size + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_DecryptFinal(hSession: number, pLastPart: Buffer, pulLastPartLen: Buffer): number; + C_DecryptFinal(hSession: number, pLastPart: Buffer, pulLastPartLen: Buffer, callback: Callback): void; + /** + * C_DigestInit initializes a message-digesting operation. + * @param {number} hSession the session's handle + * @param {Buffer} pMechanism the digesting mechanism + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_DigestInit(hSession: number, pMechanism: Buffer): number; + C_DigestInit(hSession: number, pMechanism: Buffer, callback: Callback): void; + /** + * C_Digest digests data in a single part. + * @param {number} hSession the session's handle + * @param {Buffer} pData data to be digested + * @param {number} ulDataLen bytes of data to digest + * @param {Buffer} pDigest gets the message digest + * @param {Buffer} pulDigestLen gets digest length + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_Digest(hSession: number, pData: Buffer, ulDataLen: number, pDigest: Buffer, pulDigestLen: Buffer): number; + C_Digest(hSession: number, pData: Buffer, ulDataLen: number, pDigest: Buffer, pulDigestLen: Buffer, callback: Callback): void; + /** + * C_DigestUpdate continues a multiple-part message-digesting operation. + * @param {number} hSession the session's handle + * @param {Buffer} pPart data to be digested + * @param {number} ulPartLen bytes of data to be digested + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_DigestUpdate(hSession: number, pPart: Buffer, ulPartLen: number): number; + C_DigestUpdate(hSession: number, pPart: Buffer, ulPartLen: number, callback: Callback): void; + /** + * C_DigestKey continues a multi-part message-digesting operation, + * by digesting the value of a secret key as part of + * the data already digested. + * @param {number} hSession the session's handle + * @param {number} hKey secret key to digest + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_DigestKey(hSession: number, hKey: number): number; + C_DigestKey(hSession: number, hKey: number, callback: Callback): void; + /** + * C_DigestFinal finishes a multiple-part message-digesting + * operation. + * @param {number} hSession the session's handle + * @param {Buffer} pDigest gets the message digest + * @param {Buffer} pulDigestLen gets byte count of digest + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_DigestFinal(hSession: number, pDigest: Buffer, pulDigestLen: Buffer): number; + C_DigestFinal(hSession: number, pDigest: Buffer, pulDigestLen: Buffer, callback: Callback): void; + /** + * C_SignInit initializes a signature (private key encryption) + * operation, where the signature is (will be) an appendix to + * the data, and plaintext cannot be recovered from the signature. + * @param {number} hSession the session's handle + * @param {Buffer} pMechanism the signature mechanism + * @param {number} hKey handle of signature key + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_SignInit(hSession: number, pMechanism: Buffer, hKey: number): number; + C_SignInit(hSession: number, pMechanism: Buffer, hKey: number, callback: Callback): void; + /** + * C_Sign signs (encrypts with private key) data in a single + * part, where the signature is (will be) an appendix to the + * data, and plaintext cannot be recovered from the signature. + * @param {number} hSession the session's handle + * @param {Buffer} pData the data to sign + * @param {number} ulDataLen count of bytes to sign + * @param {Buffer} pSignature gets the signature + * @param {Buffer} pulSignatureLen gets signature length + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_Sign(hSession: number, pData: Buffer, ulDataLen: number, pSignature: Buffer, pulSignatureLen: Buffer): number; + C_Sign(hSession: number, pData: Buffer, ulDataLen: number, pSignature: Buffer, pulSignatureLen: Buffer, callback: Callback): void; + /** + * C_SignUpdate continues a multiple-part signature operation, + * where the signature is (will be) an appendix to the data, + * and plaintext cannot be recovered from the signature. + * @param {number} hSession the session's handle + * @param {Buffer} pPart the data to sign + * @param {number} ulPartLen count of bytes to sign + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_SignUpdate(hSession: number, pPart: Buffer, ulPartLen: Buffer): number; + C_SignUpdate(hSession: number, pPart: Buffer, ulPartLen: Buffer, callback: Callback): void; + /** + * C_SignFinal finishes a multiple-part signature operation, + * returning the signature. + * @param {number} hSession the session's handle + * @param {Buffer} pSignature gets the signature + * @param {Buffer} pulSignatureLen gets signature length + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_SignFinal(hSession: number, pSignature: Buffer, pulSignatureLen: Buffer): number; + C_SignFinal(hSession: number, pSignature: Buffer, pulSignatureLen: Buffer, callback: Callback): void; + /** + * C_SignRecoverInit initializes a signature operation, where + * the data can be recovered from the signature. + * @param {number} hSession the session's handle + * @param {Buffer} pMechanism the signature mechanism + * @param {number} hKey handle of the signature key + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_SignRecoverInit(hSession: number, pMechanism: Buffer, hKey: number): number; + C_SignRecoverInit(hSession: number, pMechanism: Buffer, hKey: number, callback: Callback): void; + /** + * C_SignRecover signs data in a single operation, where the + * data can be recovered from the signature. + * @param {number} hSession the session's handle + * @param {Buffer} pData the data to sign + * @param {number} ulDataLen count of bytes to sign + * @param {Buffer} pSignature gets the signature + * @param {Buffer} pulSignatureLen gets signature length + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_SignRecover(hSession: number, pData: Buffer, ulDataLen: number, pSignature: Buffer, pulSignatureLen: Buffer): number; + C_SignRecover(hSession: number, pData: Buffer, ulDataLen: number, pSignature: Buffer, pulSignatureLen: Buffer, callback: Callback): void; + /** + * C_VerifyInit initializes a verification operation, where the + * signature is an appendix to the data, and plaintext cannot + * cannot be recovered from the signature (e.g. DSA). + * @param {number} hSession the session's handle + * @param {Buffer} pMechanism the verification mechanism + * @param {number} hKey verification key + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_VerifyInit(hSession: number, pMechanism: Buffer, hKey: number): number; + C_VerifyInit(hSession: number, pMechanism: Buffer, hKey: number, callback: Callback): void; + /** + * C_Verify verifies a signature in a single-part operation, + * where the signature is an appendix to the data, and plaintext + * cannot be recovered from the signature. + * @param {number} hSession the session's handle + * @param {Buffer} pData signed data + * @param {number} ulDataLen length of signed data + * @param {Buffer} pSignature signature + * @param {number} ulSignatureLen signature length + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_Verify(hSession: number, pData: Buffer, ulDataLen: number, pSignature: Buffer, ulSignatureLen: Buffer): number; + C_Verify(hSession: number, pData: Buffer, ulDataLen: number, pSignature: Buffer, ulSignatureLen: Buffer, callback: Callback): void; + /** + * C_VerifyUpdate continues a multiple-part verification + * operation, where the signature is an appendix to the data, + * and plaintext cannot be recovered from the signature. + * @param {number} hSession the session's handle + * @param {Buffer} pPart signed data + * @param {number} ulPartLen length of signed data + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_VerifyUpdate(hSession: number, pPart: Buffer, ulPartLen: number): number; + C_VerifyUpdate(hSession: number, pPart: Buffer, ulPartLen: number, callback: Callback): void; + /** + * C_VerifyFinal finishes a multiple-part verification + * operation, checking the signature. + * @param {number} hSession the session's handle + * @param {Buffer} pSignature signature to verify + * @param {number} ulSignatureLen signature length + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_VerifyFinal(hSession: number, pSignature: Buffer, ulSignatureLen: number): number; + C_VerifyFinal(hSession: number, pSignature: Buffer, ulSignatureLen: number, callback: Callback): void; + /** + * C_VerifyRecoverInit initializes a signature verification + * operation, where the data is recovered from the signature. + * @param {number} hSession the session's handle + * @param {Buffer} pMechanism the verification mechanism + * @param {number} hKey verification key + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_VerifyRecoverInit(hSession: number, pMechanism: Buffer, hKey: number): number; + C_VerifyRecoverInit(hSession: number, pMechanism: Buffer, hKey: number, callback: Callback): void; + /** + * C_VerifyRecover verifies a signature in a single-part + * operation, where the data is recovered from the signature. + * @param {number} hSession the session's handle + * @param {Buffer} pSignature signature to verify + * @param {number} ulSignatureLen signature length + * @param {Buffer} pData gets signed data + * @param {Buffer} pulDataLen gets signed data len + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_VerifyRecover(hSession: number, pSignature: Buffer, ulSignatureLen: number, pData: Buffer, pulDataLen: Buffer): number; + C_VerifyRecover(hSession: number, pSignature: Buffer, ulSignatureLen: number, pData: Buffer, pulDataLen: Buffer, callback: Callback): void; + /** + * C_DigestEncryptUpdate continues a multiple-part digesting + * and encryption operation. + * @param {number} hSession the session's handle + * @param {Buffer} pPart the plaintext data + * @param {number} ulPartLen plaintext length + * @param {Buffer} pEncryptedPart gets ciphertext + * @param {Buffer} pulEncryptedPartLen gets c-text length + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_DigestEncryptUpdate(hSession: number, pPart: Buffer, ulPartLen: number, pEncryptedPart: Buffer, pulEncryptedPartLen: Buffer): number; + C_DigestEncryptUpdate(hSession: number, pPart: Buffer, ulPartLen: number, pEncryptedPart: Buffer, pulEncryptedPartLen: Buffer, callback: Callback): void; + /** + * C_DecryptDigestUpdate continues a multiple-part decryption and + * digesting operation. + * @param {number} hSession the session's handle + * @param {Buffer} pEncryptedPart ciphertext + * @param {number} ulEncryptedPartLen ciphertext length + * @param {Buffer} pPart gets plaintext + * @param {Buffer} pulPartLen gets plaintext len + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_DecryptDigestUpdate(hSession: number, pEncryptedPart: Buffer, ulEncryptedPartLen: number, pPart: Buffer, pulPartLen: Buffer): number; + C_DecryptDigestUpdate(hSession: number, pEncryptedPart: Buffer, ulEncryptedPartLen: number, pPart: Buffer, pulPartLen: Buffer, callback: Callback): void; + /** + * C_SignEncryptUpdate continues a multiple-part signing and + * encryption operation. + * @param {number} hSession the session's handle + * @param {Buffer} pPart the plaintext data + * @param {number} ulPartLen plaintext length + * @param {Buffer} pEncryptedPart gets ciphertext + * @param {Buffer} pulEncryptedPartLen gets c-text length + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_SignEncryptUpdate(hSession: number, pPart: Buffer, ulPartLen: number, pEncryptedPart: Buffer, pulEncryptedPartLen: Buffer): number; + C_SignEncryptUpdate(hSession: number, pPart: Buffer, ulPartLen: number, pEncryptedPart: Buffer, pulEncryptedPartLen: Buffer, callback: Callback): void; + /** + * C_DecryptVerifyUpdate continues a multiple-part decryption and + * verify operation. + * @param {number} hSession the session's handle + * @param {Buffer} pEncryptedPart ciphertext + * @param {number} ulEncryptedPartLen ciphertext length + * @param {Buffer} pPart gets plaintext + * @param {Buffer} pulPartLen gets p-text length + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_DecryptVerifyUpdate(hSession: number, pEncryptedPart: Buffer, ulEncryptedPartLen: number, pPart: Buffer, pulPartLen: Buffer): number; + C_DecryptVerifyUpdate(hSession: number, pEncryptedPart: Buffer, ulEncryptedPartLen: number, pPart: Buffer, pulPartLen: Buffer, callback: Callback): void; + /** + * C_GenerateKey generates a secret key, creating a new key object. + * @param {number} hSession the session's handle + * @param {Buffer} pMechanism key generation mech. + * @param {Buffer} pTemplate template for new key + * @param {number} ulCount # of attrs in template + * @param {Buffer} phKey gets handle of new key + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_GenerateKey(hSession: number, pMechanism: Buffer, pTemplate: Buffer, ulCount: number, phKey: Buffer): number; + C_GenerateKey(hSession: number, pMechanism: Buffer, pTemplate: Buffer, ulCount: number, phKey: Buffer, callback: Callback): any; + /** + * C_GenerateKeyPair generates a public-key/private-key pair, + * creating new key objects. + * @param {number} hSession the session's handle + * @param {Buffer} pMechanism key-gen mech. + * @param {Buffer} pPublicKeyTemplate template for public key + * @param {number} ulPublicKeyAttributeCount public attrs + * @param {Buffer} pPrivateKeyTemplate template for private key + * @param {number} ulPrivateKeyAttributeCount private attrs + * @param {Buffer} phPublicKey gets public key handle + * @param {Buffer} phPrivateKey gets private key handle + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_GenerateKeyPair(hSession: number, pMechanism: Buffer, pPublicKeyTemplate: Buffer, ulPublicKeyAttributeCount: number, pPrivateKeyTemplate: Buffer, ulPrivateKeyAttributeCount: number, phPublicKey: Buffer, phPrivateKey: Buffer): number; + C_GenerateKeyPair(hSession: number, pMechanism: Buffer, pPublicKeyTemplate: Buffer, ulPublicKeyAttributeCount: number, pPrivateKeyTemplate: Buffer, ulPrivateKeyAttributeCount: number, phPublicKey: Buffer, phPrivateKey: Buffer, callback: Callback): void; + /** + * C_WrapKey wraps (i.e., encrypts) a key. + * @param {number} hSession the session's handle + * @param {Buffer} pMechanism the wrapping mechanism + * @param {number} hWrappingKey wrapping key + * @param {number} hKey key to be wrapped + * @param {Buffer} pWrappedKey gets wrapped key + * @param {Buffer} pulWrappedKeyLen gets wrapped key size + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_WrapKey(hSession: number, pMechanism: Buffer, hWrappingKey: number, hKey: number, pWrappedKey: Buffer, pulWrappedKeyLen: Buffer): number; + C_WrapKey(hSession: number, pMechanism: Buffer, hWrappingKey: number, hKey: number, pWrappedKey: Buffer, pulWrappedKeyLen: Buffer, callback: Callback): void; + /** + * C_UnwrapKey unwraps (decrypts) a wrapped key, creating a new + * key object. + * @param {number} hSession the session's handle + * @param {Buffer} pMechanism unwrapping mech. + * @param {Buffer} pWrappedKey the wrapped key + * @param {number} ulWrappedKeyLen wrapped key len + * @param {Buffer} pTemplate new key template + * @param {number} ulAttributeCount template length + * @param {Buffer} pTemplate new key template + * @param {number} ulAttributeCount template length + * @param {Buffer} phKey gets new handle + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_UnwrapKey(hSession: number, pMechanism: Buffer, hUnwrappingKey: number, pWrappedKey: Buffer, ulWrappedKeyLen: number, pTemplate: Buffer, ulAttributeCount: number, phKey: Buffer): number; + C_UnwrapKey(hSession: number, pMechanism: Buffer, hUnwrappingKey: number, pWrappedKey: Buffer, ulWrappedKeyLen: number, pTemplate: Buffer, ulAttributeCount: number, phKey: Buffer, callback: Callback): void; + /** + * C_DeriveKey derives a key from a base key, creating a new key object. + * @param {number} hSession the session's handle + * @param {Buffer} pMechanism key deriv. mech. + * @param {number} hBaseKey base key + * @param {Buffer} pTemplate new key template + * @param {number} ulAttributeCount template length + * @param {Buffer} phKey gets new handle + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_DeriveKey(hSession: number, pMechanism: Buffer, hBaseKey: number, pTemplate: Buffer, ulAttributeCount: number, phKey: Buffer): number; + C_DeriveKey(hSession: number, pMechanism: Buffer, hBaseKey: number, pTemplate: Buffer, ulAttributeCount: number, phKey: Buffer, callback: Callback): void; + /** + * C_SeedRandom mixes additional seed material into the token's + * random number generator. + * @param {number} hSession the session's handle + * @param {Buffer} pSeed the seed material + * @param {number} ulSeedLen length of seed material + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_SeedRandom(hSession: number, pSeed: Buffer, ulSeedLen: number): number; + C_SeedRandom(hSession: number, pSeed: Buffer, ulSeedLen: number, callback: Callback): void; + /** + * C_GenerateRandom generates random data. + * @param {number} hSession the session's handle + * @param {Buffer} pRandomData receives the random data + * @param {number} ulRandomLen # of bytes to generate + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_GenerateRandom(hSession: number, pRandomData: Buffer, ulRandomLen: number): number; + C_GenerateRandom(hSession: number, pRandomData: Buffer, ulRandomLen: number, callback: Callback): void; + /** + * C_GetFunctionStatus is a legacy function; it obtains an + * updated status of a function running in parallel with an + * application. + * @param {number} hSession the session's handle + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_GetFunctionStatus(hSession: number): number; + C_GetFunctionStatus(hSession: number, callback: Callback): void; + /** + * C_CancelFunction is a legacy function; it cancels a function + * running in parallel. + * @param {number} hSession the session's handle + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_CancelFunction(hSession: number): number; + C_CancelFunction(hSession: number, callback: Callback): void; + /** + * C_WaitForSlotEvent waits for a slot event (token insertion, + * removal, etc.) to occur. + * @param {number} flags blocking/nonblocking flag + * @param {Buffer} pSlot location that receives the slot ID + * @param {Buffer} pRserved reserved. Should be NULL_PTR + * @param {Callback} callback callback function with PKCS11 result value + * @returns void PKCS11 result value + */ + C_WaitForSlotEvent(flags: number, pSlot: Buffer, pRserved: Buffer): number; + C_WaitForSlotEvent(flags: number, pSlot: Buffer, pRserved: Buffer, callback: Callback): number; + } + + enum KeyType { + RSA, + DSA, + DH, + ECDSA, + EC, + X9_42_DH, + KEA, + GENERIC_SECRET, + RC2, + RC4, + DES, + DES2, + DES3, + CAST, + CAST3, + CAST5, + CAST128, + RC5, + IDEA, + SKIPJACK, + BATON, + JUNIPER, + CDMF, + AES, + GOSTR3410, + GOSTR3411, + GOST28147, + BLOWFISH, + TWOFISH, + SECURID, + HOTP, + ACTI, + CAMELLIA, + ARIA, + } + enum KeyGenMechanism { + AES, + RSA, + RSA_X9_31, + DSA, + DH_PKCS, + DH_X9_42, + GOSTR3410, + GOST28147, + RC2, + RC4, + DES, + DES2, + SECURID, + ACTI, + CAST, + CAST3, + CAST5, + CAST128, + RC5, + IDEA, + GENERIC_SECRET, + SSL3_PRE_MASTER, + CAMELLIA, + ARIA, + SKIPJACK, + KEA, + BATON, + ECDSA, + EC, + JUNIPER, + TWOFISH, + } + + enum MechanismEnum { + RSA_PKCS_KEY_PAIR_GEN, + RSA_PKCS, + RSA_9796, + RSA_X_509, + MD2_RSA_PKCS, + MD5_RSA_PKCS, + SHA1_RSA_PKCS, + RIPEMD128_RSA_PKCS, + RIPEMD160_RSA_PKCS, + RSA_PKCS_OAEP, + RSA_X9_31_KEY_PAIR_GEN, + RSA_X9_31, + SHA1_RSA_X9_31, + RSA_PKCS_PSS, + SHA1_RSA_PKCS_PSS, + DSA_KEY_PAIR_GEN, + DSA, + DSA_SHA1, + DH_PKCS_KEY_PAIR_GEN, + DH_PKCS_DERIVE, + X9_42_DH_KEY_PAIR_GEN, + X9_42_DH_DERIVE, + X9_42_DH_HYBRID_DERIVE, + X9_42_MQV_DERIVE, + SHA256_RSA_PKCS, + SHA384_RSA_PKCS, + SHA512_RSA_PKCS, + SHA256_RSA_PKCS_PSS, + SHA384_RSA_PKCS_PSS, + SHA512_RSA_PKCS_PSS, + SHA224_RSA_PKCS, + SHA224_RSA_PKCS_PSS, + RC2_KEY_GEN, + RC2_ECB, + RC2_CBC, + RC2_MAC, + RC2_MAC_GENERAL, + RC2_CBC_PAD, + RC4_KEY_GEN, + RC4, + DES_KEY_GEN, + DES_ECB, + DES_CBC, + DES_MAC, + DES_MAC_GENERAL, + DES_CBC_PAD, + DES2_KEY_GEN, + DES3_KEY_GEN, + DES3_ECB, + DES3_CBC, + DES3_MAC, + DES3_MAC_GENERAL, + DES3_CBC_PAD, + CDMF_KEY_GEN, + CDMF_ECB, + CDMF_CBC, + CDMF_MAC, + CDMF_MAC_GENERAL, + CDMF_CBC_PAD, + DES_OFB64, + DES_OFB8, + DES_CFB64, + DES_CFB8, + MD2, + MD2_HMAC, + MD2_HMAC_GENERAL, + MD5, + MD5_HMAC, + MD5_HMAC_GENERAL, + SHA1, + SHA, + SHA_1, + SHA_1_HMAC, + SHA_1_HMAC_GENERAL, + RIPEMD128, + RIPEMD128_HMAC, + RIPEMD128_HMAC_GENERAL, + RIPEMD160, + RIPEMD160_HMAC, + RIPEMD160_HMAC_GENERAL, + SHA256, + SHA256_HMAC, + SHA256_HMAC_GENERAL, + SHA224, + SHA224_HMAC, + SHA224_HMAC_GENERAL, + SHA384, + SHA384_HMAC, + SHA384_HMAC_GENERAL, + SHA512, + SHA512_HMAC, + SHA512_HMAC_GENERAL, + SECURID_KEY_GEN, + SECURID, + HOTP_KEY_GEN, + HOTP, + ACTI, + ACTI_KEY_GEN, + CAST_KEY_GEN, + CAST_ECB, + CAST_CBC, + CAST_MAC, + CAST_MAC_GENERAL, + CAST_CBC_PAD, + CAST3_KEY_GEN, + CAST3_ECB, + CAST3_CBC, + CAST3_MAC, + CAST3_MAC_GENERAL, + CAST3_CBC_PAD, + CAST5_KEY_GEN, + CAST128_KEY_GEN, + CAST5_ECB, + CAST128_ECB, + CAST5_CBC, + CAST128_CBC, + CAST5_MAC, + CAST128_MAC, + CAST5_MAC_GENERAL, + CAST128_MAC_GENERAL, + CAST5_CBC_PAD, + CAST128_CBC_PAD, + RC5_KEY_GEN, + RC5_ECB, + RC5_CBC, + RC5_MAC, + RC5_MAC_GENERAL, + RC5_CBC_PAD, + IDEA_KEY_GEN, + IDEA_ECB, + IDEA_CBC, + IDEA_MAC, + IDEA_MAC_GENERAL, + IDEA_CBC_PAD, + GENERIC_SECRET_KEY_GEN, + CONCATENATE_BASE_AND_KEY, + CONCATENATE_BASE_AND_DATA, + CONCATENATE_DATA_AND_BASE, + XOR_BASE_AND_DATA, + EXTRACT_KEY_FROM_KEY, + SSL3_PRE_MASTER_KEY_GEN, + SSL3_MASTER_KEY_DERIVE, + SSL3_KEY_AND_MAC_DERIVE, + SSL3_MASTER_KEY_DERIVE_DH, + TLS_PRE_MASTER_KEY_GEN, + TLS_MASTER_KEY_DERIVE, + TLS_KEY_AND_MAC_DERIVE, + TLS_MASTER_KEY_DERIVE_DH, + TLS_PRF, + SSL3_MD5_MAC, + SSL3_SHA1_MAC, + MD5_KEY_DERIVATION, + MD2_KEY_DERIVATION, + SHA1_KEY_DERIVATION, + SHA256_KEY_DERIVATION, + SHA384_KEY_DERIVATION, + SHA512_KEY_DERIVATION, + SHA224_KEY_DERIVATION, + PBE_MD2_DES_CBC, + PBE_MD5_DES_CBC, + PBE_MD5_CAST_CBC, + PBE_MD5_CAST3_CBC, + PBE_MD5_CAST5_CBC, + PBE_MD5_CAST128_CBC, + PBE_SHA1_CAST5_CBC, + PBE_SHA1_CAST128_CBC, + PBE_SHA1_RC4_128, + PBE_SHA1_RC4_40, + PBE_SHA1_DES3_EDE_CBC, + PBE_SHA1_DES2_EDE_CBC, + PBE_SHA1_RC2_128_CBC, + PBE_SHA1_RC2_40_CBC, + PKCS5_PBKD2, + PBA_SHA1_WITH_SHA1_HMAC, + WTLS_PRE_MASTER_KEY_GEN, + WTLS_MASTER_KEY_DERIVE, + WTLS_MASTER_KEY_DERIVE_DH_ECC, + WTLS_PRF, + WTLS_SERVER_KEY_AND_MAC_DERIVE, + WTLS_CLIENT_KEY_AND_MAC_DERIVE, + KEY_WRAP_LYNKS, + KEY_WRAP_SET_OAEP, + CMS_SIG, + KIP_DERIVE, + KIP_WRAP, + KIP_MAC, + CAMELLIA_KEY_GEN, + CAMELLIA_ECB, + CAMELLIA_CBC, + CAMELLIA_MAC, + CAMELLIA_MAC_GENERAL, + CAMELLIA_CBC_PAD, + CAMELLIA_ECB_ENCRYPT_DATA, + CAMELLIA_CBC_ENCRYPT_DATA, + CAMELLIA_CTR, + ARIA_KEY_GEN, + ARIA_ECB, + ARIA_CBC, + ARIA_MAC, + ARIA_MAC_GENERAL, + ARIA_CBC_PAD, + ARIA_ECB_ENCRYPT_DATA, + ARIA_CBC_ENCRYPT_DATA, + SKIPJACK_KEY_GEN, + SKIPJACK_ECB64, + SKIPJACK_CBC64, + SKIPJACK_OFB64, + SKIPJACK_CFB64, + SKIPJACK_CFB32, + SKIPJACK_CFB16, + SKIPJACK_CFB8, + SKIPJACK_WRAP, + SKIPJACK_PRIVATE_WRAP, + SKIPJACK_RELAYX, + KEA_KEY_PAIR_GEN, + KEA_KEY_DERIVE, + FORTEZZA_TIMESTAMP, + BATON_KEY_GEN, + BATON_ECB128, + BATON_ECB96, + BATON_CBC128, + BATON_COUNTER, + BATON_SHUFFLE, + BATON_WRAP, + ECDSA_KEY_PAIR_GEN, + EC_KEY_PAIR_GEN, + ECDSA, + ECDSA_SHA1, + ECDSA_SHA224, + ECDSA_SHA256, + ECDSA_SHA384, + ECDSA_SHA512, + ECDH1_DERIVE, + ECDH1_COFACTOR_DERIVE, + ECMQV_DERIVE, + JUNIPER_KEY_GEN, + JUNIPER_ECB128, + JUNIPER_CBC128, + JUNIPER_COUNTER, + JUNIPER_SHUFFLE, + JUNIPER_WRAP, + FASTHASH, + AES_KEY_GEN, + AES_ECB, + AES_CBC, + AES_MAC, + AES_MAC_GENERAL, + AES_CBC_PAD, + AES_CTR, + AES_CMAC, + AES_CMAC_GENERAL, + BLOWFISH_KEY_GEN, + BLOWFISH_CBC, + TWOFISH_KEY_GEN, + TWOFISH_CBC, + AES_GCM, + AES_CCM, + AES_KEY_WRAP, + AES_KEY_WRAP_PAD, + DES_ECB_ENCRYPT_DATA, + DES_CBC_ENCRYPT_DATA, + DES3_ECB_ENCRYPT_DATA, + DES3_CBC_ENCRYPT_DATA, + AES_ECB_ENCRYPT_DATA, + AES_CBC_ENCRYPT_DATA, + GOSTR3410_KEY_PAIR_GEN, + GOSTR3410, + GOSTR3410_WITH_GOSTR3411, + GOSTR3410_KEY_WRAP, + GOSTR3410_DERIVE, + GOSTR3411, + GOSTR3411_HMAC, + GOST28147_KEY_GEN, + GOST28147_ECB, + GOST28147, + GOST28147_MAC, + GOST28147_KEY_WRAP, + DSA_PARAMETER_GEN, + DH_PKCS_PARAMETER_GEN, + X9_42_DH_PARAMETER_GEN, + VENDOR_DEFINED, + } + + interface IParams { + toCKI(): Buffer; + } + + interface IAlgorithm { + name: string; + params: Buffer | IParams; + } + + type MechanismType = MechanismEnum | KeyGenMechanism | IAlgorithm | string; + + enum MechanismFlag { + /** + * `True` if the mechanism is performed by the device; `false` if the mechanism is performed in software + */ + HW, + /** + * `True` if the mechanism can be used with encrypt function + */ + ENCRYPT, + /** + * `True` if the mechanism can be used with decrypt function + */ + DECRYPT, + /** + * `True` if the mechanism can be used with digest function + */ + DIGEST, + /** + * `True` if the mechanism can be used with sign function + */ + SIGN, + /** + * `True` if the mechanism can be used with sign recover function + */ + SIGN_RECOVER, + /** + * `True` if the mechanism can be used with verify function + */ + VERIFY, + /** + * `True` if the mechanism can be used with verify recover function + */ + VERIFY_RECOVER, + /** + * `True` if the mechanism can be used with geberate function + */ + GENERATE, + /** + * `True` if the mechanism can be used with generate key pair function + */ + GENERATE_KEY_PAIR, + /** + * `True` if the mechanism can be used with wrap function + */ + WRAP, + /** + * `True` if the mechanism can be used with unwrap function + */ + UNWRAP, + /** + * `True` if the mechanism can be used with derive function + */ + DERIVE, + } + class Mechanism extends HandleObject { + protected slotHandle: number; + /** + * the minimum size of the key for the mechanism + * _whether this is measured in bits or in bytes is mechanism-dependent_ + */ + minKeySize: number; + /** + * the maximum size of the key for the mechanism + * _whether this is measured in bits or in bytes is mechanism-dependent_ + */ + maxKeySize: number; + /** + * bit flag specifying mechanism capabilities + */ + flags: number; + /** + * returns string name from MechanismEnum + */ + name: string; + constructor(handle: number, slotHandle: number, lib: Pkcs11); + protected getInfo(): void; + static create(alg: MechanismType): Buffer; + static vendor(jsonFile: string): any; + static vendor(name: string, value: number): any; + } + + class MechanismCollection extends Collection { + protected slotHandle: number; + constructor(items: Array, slotHandle: number, lib: Pkcs11, classType?: typeof Mechanism); + /** + * returns item from collection by index + * @param {number} index of element in collection `[0..n]` + */ + items(index: number): Mechanism; + } + + /** + * Definition for the base key object class + * - defines the object class `CKO_PUBLIC_KEY`, `CKO_PRIVATE_KEY` and `CKO_SECRET_KEY` for type `CK_OBJECT_CLASS` + * as used in the `CKA_CLASS` attribute of objects + */ + class Key extends Storage { + /** + * Type of key + * - Must be specified when object is created with `C_CreateObject` + * - Must be specified when object is unwrapped with `C_UnwrapKey` + */ + type: KeyType; + /** + * Key identifier for key (default empty) + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification + * of the attribute during the course of a `C_CopyObject` call. + */ + id: Buffer; + /** + * Start date for the key (default empty) + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification + * of the attribute during the course of a `C_CopyObject` call. + */ + startDate: Date; + /** + * End date for the key (default empty) + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification + * of the attribute during the course of a `C_CopyObject` call. + */ + endDate: Date; + /** + * `CK_TRUE` if key supports key derivation + * (i.e., if other keys can be derived from this one (default `CK_FALSE`) + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification + * of the attribute during the course of a `C_CopyObject` call. + * @returns boolean + */ + derive: boolean; + /** + * `CK_TRUE` only if key was either * generated locally (i.e., on the token) + * with a `C_GenerateKey` or `C_GenerateKeyPair` call * created with a `C_CopyObject` call + * as a copy of a key which had its `CKA_LOCAL` attribute set to `CK_TRUE` + * - Must not be specified when object is created with `C_CreateObject`. + * - Must not be specified when object is generated with `C_GenerateKey` or `C_GenerateKeyPair`. + * - Must not be specified when object is unwrapped with `C_UnwrapKey`. + */ + local: boolean; + /** + * Identifier of the mechanism used to generate the key material. + * - Must not be specified when object is created with `C_CreateObject`. + * - Must not be specified when object is generated with `C_GenerateKey` or `C_GenerateKeyPair`. + * - Must not be specified when object is unwrapped with `C_UnwrapKey`. + */ + mechanism: KeyGenMechanism; + allowedMechanisms: void; + } + + + class DomainParameters extends Storage { + /** + * Type of key the domain parameters can be used to generate. + */ + keyType: KeyType; + /** + * `CK_TRUE` only if domain parameters were either * generated locally (i.e., on the token) + * with a `C_GenerateKey` * created with a `C_CopyObject` call as a copy of domain parameters + * which had its `CKA_LOCAL` attribute set to `CK_TRUE` + */ + local: boolean; + } + + /** + * Data objects (object class `CKO_DATA`) hold information defined by an application. + * Other than providing access to it, Cryptoki does not attach any special meaning to a data object + */ + class Data extends Storage { + /** + * Description of the application that manages the object (default empty) + */ + application: string; + /** + * DER-encoding of the object identifier indicating the data object type (default empty) + */ + objectId: Buffer; + /** + * Value of the object (default empty) + */ + value: Buffer; + } + + interface ITemplate { + /** + * CKA_CLASS + */ + class?: number; + /** + * CKA_TOKEN + */ + token?: boolean; + /** + * CKA_PRIVATE + */ + private?: boolean; + /** + * CKA_LABEL + */ + label?: string; + /** + * CKA_APPLICATION + */ + application?: string; + /** + * CKA_VALUE + */ + value?: Buffer; + /** + * CKA_OBJECT_ID + */ + objectId?: Buffer; + /** + * CKA_CERTIFICATE_TYPE + */ + certType?: number; + /** + * CKA_ISSUER + */ + issuer?: Buffer; + /** + * CKA_SERIAL_NUMBER + */ + serial?: Buffer; + /** + * CKA_AC_ISSUER + */ + issuerAC?: Buffer; + /** + * CKA_OWNER + */ + owner?: Buffer; + /** + * CKA_ATTR_TYPES + */ + attrTypes?: Buffer; + /** + * CKA_TRUSTED + */ + trusted?: boolean; + /** + * CKA_CERTIFICATE_CATEGORY + */ + certCategory?: number; + /** + * CKA_JAVA_MIDP_SECURITY_DOMAIN + */ + javaDomain?: number; + /** + * CKA_URL + */ + url?: string; + /** + * CKA_HASH_OF_SUBJECT_PUBLIC_KEY + */ + ski?: Buffer; + /** + * CKA_HASH_OF_ISSUER_PUBLIC_KEY + */ + aki?: Buffer; + /** + * CKA_NAME_HASH_ALGORITHM + */ + digestName?: number; + /** + * CKA_CHECK_VALUE + */ + checkValue?: Buffer; + /** + * CKA_KEY_TYPE + */ + keyType?: number; + /** + * CKA_SUBJECT + */ + subject?: Buffer; + /** + * CKA_ID + */ + id?: Buffer; + /** + * CKA_SENSITIVE + */ + sensitive?: boolean; + /** + * CKA_ENCRYPT + */ + encrypt?: boolean; + /** + * CKA_DECRYPT + */ + decrypt?: boolean; + /** + * CKA_WRAP + */ + wrap?: boolean; + /** + * CKA_UNWRAP + */ + unwrap?: boolean; + /** + * CKA_SIGN + */ + sign?: boolean; + /** + * CKA_SIGN_RECOVER + */ + signRecover?: boolean; + /** + * CKA_VERIFY + */ + verify?: boolean; + /** + * CKA_VERIFY_RECOVER + */ + verifyRecover?: boolean; + /** + * CKA_DERIVE + */ + derive?: boolean; + /** + * CKA_START_DATE + */ + startDate?: Date; + /** + * CKA_END_DATE + */ + endDate?: Date; + /** + * CKA_MODULUS + */ + modulus?: Buffer; + /** + * CKA_MODULUS_BITS + */ + modulusBits?: number; + /** + * CKA_PUBLIC_EXPONENT + */ + publicExponent?: Buffer; + /** + * CKA_PRIVATE_EXPONEN + */ + privateExponent?: Buffer; + /** + * CKA_PRIME_1 + */ + prime1?: Buffer; + /** + * CKA_PRIME_2 + */ + prime2?: Buffer; + /** + * CKA_EXPONENT_1 + */ + exp1?: Buffer; + /** + * CKA_EXPONENT_2 + */ + exp2?: Buffer; + /** + * CKA_COEFFICIEN + */ + coefficient?: Buffer; + /** + * CKA_PRIME + */ + prime?: Buffer; + /** + * CKA_SUBPRIME + */ + subprime?: Buffer; + /** + * CKA_BASE + */ + base?: Buffer; + /** + * CKA_PRIME_BITS + */ + primeBits?: number; + /** + * CKA_SUBPRIME_BITS + */ + subprimeBits?: number; + /** + * CKA_VALUE_BITS + */ + valueBits?: number; + /** + * CKA_VALUE_LEN + */ + valueLen?: number; + /** + * CKA_EXTRACTABLE + */ + extractable?: boolean; + /** + * CKA_LOCAL + */ + local?: boolean; + /** + * CKA_NEVER_EXTRACTABLE + */ + neverExtractable?: boolean; + /** + * CKA_ALWAYS_SENSITIVE + */ + alwaysSensitive?: boolean; + /** + * CKA_KEY_GEN_MECHANISM + */ + keyGenMechanism?: number; + /** + * CKA_MODIFIABLE + */ + modifiable?: boolean; + /** + * CKA_COPYABLE + */ + copyable?: boolean; + /** + * CKA_ECDSA_PARAMS + */ + paramsECDSA?: Buffer; + paramsEC?: Buffer; + /** + * CKA_EC_POINT + */ + pointEC?: Buffer; + /** + * CKA_SECONDARY_AUTH + */ + secondaryAuth?: boolean; + /** + * CKA_AUTH_PIN_FLAGS + */ + authPinFlags?: Buffer; + /** + * CKA_ALWAYS_AUTHENTICATE + */ + alwaysAuth?: boolean; + /** + * CKA_WRAP_WITH_TRUSTED + */ + wrapWithTrusted?: boolean; + /** + * CKA_WRAP_TEMPLATE + */ + wrapTemplate?: any; + /** + * CKA_UNWRAP_TEMPLATE + */ + unwrapTemplate?: any; + /** + * CKA_OTP_FORMAT + */ + otpFormat?: any; + /** + * CKA_OTP_LENGTH + */ + otpLength?: any; + /** + * CKA_OTP_TIME_INTERVAL + */ + otpTimeInterval?: any; + /** + * CKA_OTP_USER_FRIENDLY_MODE + */ + otpUserFriendlyMode?: any; + /** + * CKA_OTP_CHALLENGE_REQUIREMENT + */ + otpChallengeReq?: any; + /** + * CKA_OTP_TIME_REQUIREMENT + */ + otpTimeReq?: any; + /** + * CKA_OTP_COUNTER_REQUIREMENT + */ + otpCounterReq?: any; + /** + * CKA_OTP_PIN_REQUIREMENT + */ + otppinReq?: any; + /** + * CKA_OTP_COUNTER + */ + otpCounter?: any; + /** + * CKA_OTP_TIME + */ + otpTime?: any; + /** + * CKA_OTP_USER_IDENTIFIER + */ + OtpUserId?: any; + /** + * CKA_OTP_SERVICE_IDENTIFIER + */ + otpServiceId?: any; + /** + * CKA_OTP_SERVICE_LOGO + */ + otpServiceLogo?: any; + /** + * CKA_OTP_SERVICE_LOGO_TYPE + */ + otpServiceLogoType?: any; + /** + * CKA_HW_FEATURE_TYPE + */ + hwFeatureType?: any; + /** + * CKA_RESET_ON_INIT + */ + resetOnInit?: any; + /** + * CKA_HAS_RESET + */ + hasReset?: any; + /** + * CKA_PIXEL_X + */ + pixelX?: any; + /** + * CKA_PIXEL_Y + */ + pixelY?: any; + /** + * CKA_RESOLUTION + */ + resolution?: any; + /** + * CKA_CHAR_ROWS + */ + charRows?: any; + /** + * CKA_CHAR_COLUMNS + */ + charCols?: any; + /** + * CKA_COLOR + */ + color?: any; + /** + * CKA_BITS_PER_PIXEL + */ + bitsPerPixel?: any; + /** + * CKA_CHAR_SETS + */ + charSets?: any; + /** + * CKA_ENCODING_METHODS + */ + encMethod?: any; + /** + * CKA_MIME_TYPES + */ + mimeTypes?: any; + /** + * CKA_MECHANISM_TYPE + */ + mechanismType?: any; + /** + * CKA_REQUIRED_CMS_ATTRIBUTES + */ + requiredCmsAttrs?: any; + /** + * CKA_DEFAULT_CMS_ATTRIBUTES + */ + defaultCmsAttrs?: any; + /** + * CKA_SUPPORTED_CMS_ATTRIBUTES + */ + suportedCmsAttrs?: any; + /** + * CKA_ALLOWED_MECHANISMS + */ + allowedMechanisms?: any; + } + class Attribute { + protected $value: Buffer; + type: number; + name: string; + convertType: string; + length: number; + value: any; + constructor(type: number, value?: any); + constructor(type: string, value?: any); + get(): any; + set(template: any): void; + } + class Template { + protected attrs: Attribute[]; + length: number; + constructor(template: string); + constructor(template: ITemplate); + set(v: any): Template; + ref(): Buffer; + serialize(): any; + } + + class BaseObject { + protected lib: Pkcs11; + constructor(lib?: Pkcs11); + } + class HandleObject extends BaseObject { + /** + * handle to pkcs11 object + */ + handle: number; + constructor(handle: number, lib: Pkcs11); + protected getInfo(): void; + } + + enum ObjectClass { + DATA, + CERTIFICATE, + PUBLIC_KEY, + PRIVATE_KEY, + SECRET_KEY, + HW_FEATURE, + DOMAIN_PARAMETERS, + MECHANISM, + OTP_KEY, + } + + class SessionObject extends HandleObject { + /** + * Session + */ + session: Session; + /** + * gets the size of an object in bytes + */ + size: number; + constructor(object: SessionObject); + constructor(handle: number, session: Session, lib: Pkcs11); + /** + * copies an object, creating a new object for the copy + * @param {ITemplate} template template for the new object + */ + copy(template: ITemplate): SessionObject; + /** + * destroys an object + */ + destroy(): void; + getAttribute(attr: string): ITemplate; + getAttribute(attrs: ITemplate): ITemplate; + setAttribute(attrs: string, value: any): any; + setAttribute(attrs: ITemplate): any; + protected get(name: string): any; + protected set(name: string, value: any): void; + class: ObjectClass; + toType(): T; + } + + class SessionObjectCollection extends Collection { + session: Session; + items(index: number): SessionObject; + constructor(items: Array, session: Session, lib: Pkcs11, classType?: any); + } + + /** + * Private key objects (object class `CKO_PRIVATE_KEY`) hold private keys + */ + class PrivateKey extends Key { + /** + * DER-encoding of the key subject name (default empty) + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + */ + subject: Buffer; + /** + * `CK_TRUE` if key is sensitive + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Attribute cannot be changed once set to CK_TRUE. It becomes a read only attribute. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + sensitive: boolean; + /** + * `CK_TRUE` if key supports decryption + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + decrypt: boolean; + /** + * `CK_TRUE` if key supports signatures where the signature is an appendix to the data + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + sign: boolean; + /** + * `CK_TRUE` if key supports signatures where the data can be recovered from the signature + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + signRecover: boolean; + /** + * `CK_TRUE` if key supports unwrapping (i.e., can be used to unwrap other keys) + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + unwrap: boolean; + /** + * `CK_TRUE` if key is extractable and can be wrapped + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Attribute cannot be changed once set to `CK_FALSE`. It becomes a read only attribute. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + extractable: boolean; + /** + * `CK_TRUE` if key has always had the `CKA_SENSITIVE` attribute set to `CK_TRUE` + * - Must not be specified when object is created with `C_CreateObject`. + * - Must not be specified when object is generated with `C_GenerateKey` or `C_GenerateKeyPair`. + * - Must not be specified when object is unwrapped with `C_UnwrapKey`. + */ + alwaysSensitive: boolean; + /** + * `CK_TRUE` if key has never had the `CKA_EXTRACTABLE` attribute set to `CK_TRUE` + * - Must not be specified when object is created with `C_CreateObject`. + * - Must not be specified when object is generated with `C_GenerateKey` or `C_GenerateKeyPair`. + * - Must not be specified when object is unwrapped with `C_UnwrapKey`. + */ + neverExtractable: boolean; + /** + * `CK_TRUE` if the key can only be wrapped with a wrapping key + * that has `CKA_TRUSTED` set to `CK_TRUE`. Default is `CK_FALSE`. + * - Attribute cannot be changed once set to `CK_TRUE`. It becomes a read only attribute. + */ + wrapTrusted: boolean; + /** + * For wrapping keys. The attribute template to apply to any keys unwrapped + * using this wrapping key. Any user supplied template is applied after this template + * as if the object has already been created. + */ + template: void; + alwaysAuthenticate: boolean; + } + + /** + * Public key objects (object class CKO_PUBLIC_KEY) hold public keys + */ + class PublicKey extends Key { + /** + * DER-encoding of the key subject name (default empty) + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + */ + subject: Buffer; + /** + * `CK_TRUE` if key supports encryption + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + encrypt: boolean; + /** + * `CK_TRUE` if key supports verification where the signature is an appendix to the data + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + verify: boolean; + /** + * `CK_TRUE` if key supports verification where the data is recovered from the signature + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + verifyRecover: boolean; + /** + * `CK_TRUE` if key supports wrapping (i.e., can be used to wrap other keys) + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + wrap: boolean; + /** + * The key can be trusted for the application that it was created. + * - The wrapping key can be used to wrap keys with `CKA_WRAP_WITH_TRUSTED` set to `CK_TRUE`. + * - Can only be set to CK_TRUE by the SO user. + */ + trusted: boolean; + /** + * For wrapping keys. The attribute template to match against any keys wrapped using this wrapping key. + * Keys that do not match cannot be wrapped. + */ + template: void; + } + + /** + * Secret key objects (object class `CKO_SECRET_KEY`) hold secret keys. + */ + class SecretKey extends Key { + /** + * `CK_TRUE` if key is sensitive + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Attribute cannot be changed once set to `CK_TRUE`. It becomes a read only attribute. + */ + sensitive: boolean; + /** + * `CK_TRUE` if key supports encryption + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + encrypt: boolean; + /** + * `CK_TRUE` if key supports decryption + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + decrypt: boolean; + /** + * `CK_TRUE` if key supports verification (i.e., of authentication codes) where the signature is an appendix to the data + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + verify: boolean; + /** + * `CK_TRUE` if key supports signatures (i.e., authentication codes) where the signature is an appendix to the data + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + sign: boolean; + /** + * `CK_TRUE` if key supports wrapping (i.e., can be used to wrap other keys) + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + wrap: boolean; + /** + * `CK_TRUE` if key supports unwrapping (i.e., can be used to unwrap other keys) + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + unwrap: boolean; + /** + * `CK_TRUE` if key is extractable and can be wrapped + * - May be modified after object is created with a `C_SetAttributeValue` call, + * or in the process of copying object with a `C_CopyObject` call. + * However, it is possible that a particular token may not permit modification of the attribute + * during the course of a `C_CopyObject` call. + * - Attribute cannot be changed once set to `CK_FALSE`. It becomes a read only attribute. + * - Default value is token-specific, and may depend on the values of other attributes. + */ + extractable: boolean; + /** + * `CK_TRUE` if key has always had the `CKA_SENSITIVE` attribute set to `CK_TRUE` + * - Must not be specified when object is created with `C_CreateObject`. + * - Must not be specified when object is generated with `C_GenerateKey` or `C_GenerateKeyPair`. + * - Must not be specified when object is unwrapped with `C_UnwrapKey`. + */ + alwaysSensitive: boolean; + /** + * `CK_TRUE` if key has never had the `CKA_EXTRACTABLE` attribute set to `CK_TRUE` + * - Must not be specified when object is created with `C_CreateObject`. + * - Must not be specified when object is generated with `C_GenerateKey` or `C_GenerateKeyPair`. + * - Must not be specified when object is unwrapped with `C_UnwrapKey`. + */ + neverExtractable: boolean; + /** + * Key checksum + */ + checkValue: Buffer; + /** + * `CK_TRUE` if the key can only be wrapped with a wrapping key + * that has `CKA_TRUSTED` set to `CK_TRUE`. Default is `CK_FALSE`. + * - Attribute cannot be changed once set to `CK_TRUE`. It becomes a read only attribute. + */ + wrapTrusted: boolean; + /** + * The wrapping key can be used to wrap keys with `CKA_WRAP_WITH_TRUSTED` set to `CK_TRUE`. + * - Can only be set to CK_TRUE by the SO user. + */ + trusted: boolean; + /** + * For wrapping keys. + * The attribute template to match against any keys wrapped using this wrapping key. + * Keys that do not match cannot be wrapped. + */ + wrapTemplate: void; + /** + * For wrapping keys. + * The attribute template to apply to any keys unwrapped using this wrapping key. + * Any user supplied template is applied after this template as if the object has already been created. + */ + unwrapTemplate: void; + } + + + interface ISlotInfo { + slotDescription: string; + manufacturerID: string; + flags: number; + hardwareVersion: IVersion; + firmwareVersion: IVersion; + } + + enum SlotFlag { + /** + * `True` if a token is present in the slot (e.g., a device is in the reader) + */ + TOKEN_PRESENT, + /** + * `True` if the reader supports removable devices + */ + REMOVABLE_DEVICE, + /** + * True if the slot is a hardware slot, as opposed to a software slot implementing a "soft token" + */ + HW_SLOT, + } + + interface IVersion { + major: number; + minor: number; + } + interface IModuleInfo { + cryptokiVersion: IVersion; + manufacturerID: string; + flags: number; + libraryDescription: string; + libraryVersion: IVersion; + } + + class Collection { + protected items_: Array; + protected classType: any; + protected lib: Pkcs11; + constructor(items: Array, lib: Pkcs11, classType: any); + /** + * returns length of collection + */ + length: number; + /** + * returns item from collection by index + * @param {number} index of element in collection `[0..n]` + */ + items(index: number): T; + } + + enum SessionOpenFlag { + /** + * session is r/w + */ + RW_SESSION, + /** + * no parallel + */ + SERIAL_SESSION, + } + enum SessionFlag { + /** + * `True` if the session is read/write; `false` if the session is read-only + */ + RW_SESSION, + /** + * This flag is provided for backward compatibility, and should always be set to `true` + */ + SERIAL_SESSION, + } + enum UserType { + /** + * Security Officer + */ + SO, + /** + * User + */ + USER, + /** + * Context specific + */ + CONTEXT_SPECIFIC, + } + interface IKeyPair { + privateKey: PrivateKey; + publicKey: PublicKey; + } + /** + * provides information about a session + */ + class Session extends HandleObject { + constructor(handle: number, slot: Slot, lib: Pkcs11); + slot: Slot; + /** + * the state of the session + */ + state: number; + /** + * bit flags that define the type of session + */ + flags: number; + /** + * an error code defined by the cryptographic device. Used for errors not covered by Cryptoki + */ + deviceError: number; + protected getInfo(): void; + /** + * closes a session between an application and a token + */ + close(): void; + /** + * initializes the normal user's PIN + * @param {string} pin the normal user's PIN + */ + initPin(pin: string): void; + /** + * modifies the PIN of the user who is logged in + * @param {string} oldPin + * @param {string} newPin + */ + setPin(oldPin: string, newPin: string): void; + /** + * obtains a copy of the cryptographic operations state of a session, encoded as a string of bytes + */ + getOperationState(): Buffer; + /** + * restores the cryptographic operations state of a session + * from a string of bytes obtained with getOperationState + * @param {Buffer} state the saved state + * @param {number} encryptionKey holds key which will be used for an ongoing encryption + * or decryption operation in the restored session + * (or 0 if no encryption or decryption key is needed, + * either because no such operation is ongoing in the stored session + * or because all the necessary key information is present in the saved state) + * @param {number} authenticationKey holds a handle to the key which will be used for an ongoing signature, + * MACing, or verification operation in the restored session + * (or 0 if no such key is needed, either because no such operation is ongoing in the stored session + * or because all the necessary key information is present in the saved state) + */ + setOperationState(state: Buffer, encryptionKey?: number, authenticationKey?: number): void; + /** + * logs a user into a token + * @param {string} pin the user's PIN. + * - This standard allows PIN values to contain any valid `UTF8` character, + * but the token may impose subset restrictions + * @param {} userType the user type. Default is `USER` + */ + login(pin: string, userType?: UserType): void; + /** + * logs a user out from a token + */ + logout(): void; + /** + * creates a new object + * - Only session objects can be created during a read-only session. + * - Only public objects can be created unless the normal user is logged in. + * @param {ITemplate} template the object's template + */ + create(template: ITemplate): SessionObject; + /** + * removes all session objects matched to template + * - if template is null, removes all session objects + * - returns a number of destroied session objects + * @param {ITemplate} template template + */ + destroy(template: ITemplate): number; + /** + * @param {SessionObject} object + */ + destroy(object: SessionObject): number; + destroy(): number; + /** + * removes all session objects + * - returns a number of destroied session objects + */ + clear(): number; + /** + * returns a collection of session objects mached to template + * @param template template + * @param callback optional callback function wich is called for each founded object + * - if callback function returns false, it breaks find function. + */ + find(callback?: (obj: SessionObject) => void): SessionObjectCollection; + find(template: ITemplate, callback?: (obj: SessionObject) => void): SessionObjectCollection; + /** + * Returns object from session by handle + * @param {number} handle handle of object + * @returns T + */ + getObject(handle: number): T; + /** + * generates a secret key or set of domain parameters, creating a new object. + * @param mechanism generation mechanism + * @param template template for the new key or set of domain parameters + */ + generateKey(mechanism: MechanismType, template?: ITemplate): SecretKey; + generateKey(mechanism: MechanismType, template: ITemplate, callback: (err: Error, key: SecretKey) => void): void; + generateKeyPair(mechanism: MechanismType, publicTemplate: ITemplate, privateTemplate: ITemplate): IKeyPair; + createSign(alg: MechanismType, key: Key): Sign; + createVerify(alg: MechanismType, key: Key): Verify; + createCipher(alg: MechanismType, key: Key): Cipher; + createDecipher(alg: MechanismType, key: Key): Decipher; + createDigest(alg: MechanismType): Digest; + wrapKey(alg: MechanismType, wrappingKey: Key, key: Key): Buffer; + unwrapKey(alg: MechanismType, unwrappingKey: Key, wrappedKey: Buffer, template: ITemplate): Key; + /** + * derives a key from a base key, creating a new key object + * @param {MechanismType} alg key deriv. mech + * @param {Key} baseKey base key + * @param {ITemplate} template new key template + */ + deriveKey(alg: MechanismType, baseKey: Key, template: ITemplate): SecretKey; + /** + * generates random data + * @param {number} size \# of bytes to generate + */ + generateRandom(size: number): Buffer; + } + + enum TokenFlag { + RNG, + WRITE_PROTECTED, + LOGIN_REQUIRED, + USER_PIN_INITIALIZED, + RESTORE_KEY_NOT_NEEDED, + CLOCK_ON_TOKEN, + PROTECTED_AUTHENTICATION_PATH, + DUAL_CRYPTO_OPERATIONS, + TOKEN_INITIALIZED, + SECONDARY_AUTHENTICATION, + USER_PIN_COUNT_LOW, + USER_PIN_FINAL_TRY, + USER_PIN_LOCKED, + USER_PIN_TO_BE_CHANGED, + SO_PIN_COUNT_LOW, + SO_PIN_FINAL_TRY, + SO_PIN_LOCKED, + SO_PIN_TO_BE_CHANGED, + } + class Token extends HandleObject { + /** + * application-defined label, assigned during token initialization. + * - Must be padded with the blank character (' '). + * - Should __not__ be null-terminated. + */ + label: string; + /** + * ID of the device manufacturer. + * - Must be padded with the blank character (' '). + * - Should __not__ be null-terminated. + */ + manufacturerID: string; + /** + * model of the device. + * - Must be padded with the blank character (' '). + * - Should __not__ be null-terminated. + */ + model: string; + /** + * character-string serial number of the device. + * - Must be padded with the blank character (' '). + * - Should __not__ be null-terminated. + */ + serialNumber: string; + /** + * bit flags indicating capabilities and status of the device + */ + flags: number; + /** + * maximum number of sessions that can be opened with the token at one time by a single application + */ + maxSessionCount: number; + /** + * number of sessions that this application currently has open with the token + */ + sessionCount: number; + /** + * maximum number of read/write sessions that can be opened + * with the token at one time by a single application + */ + maxRwSessionCount: number; + /** + * number of read/write sessions that this application currently has open with the token + */ + rwSessionCount: number; + /** + * maximum length in bytes of the PIN + */ + maxPinLen: number; + /** + * minimum length in bytes of the PIN + */ + minPinLen: number; + /** + * the total amount of memory on the token in bytes in which public objects may be stored + */ + totalPublicMemory: number; + /** + * the amount of free (unused) memory on the token in bytes for public objects + */ + freePublicMemory: number; + /** + * the total amount of memory on the token in bytes in which private objects may be stored + */ + totalPrivateMemory: number; + /** + * the amount of free (unused) memory on the token in bytes for private objects + */ + freePrivateMemory: number; + /** + * version number of hardware + */ + hardwareVersion: IVersion; + /** + * version number of firmware + */ + firmwareVersion: IVersion; + /** + * current time as a character-string of length 16, + * represented in the format YYYYMMDDhhmmssxx + */ + utcTime: Date; + constructor(handle: number, lib: Pkcs11); + protected getInfo(): void; + } + + class Slot extends HandleObject implements ISlotInfo { + slotDescription: string; + manufacturerID: string; + flags: number; + hardwareVersion: IVersion; + firmwareVersion: IVersion; + module: Module; + constructor(handle: number, module: Module, lib: Pkcs11); + protected getInfo(): void; + getToken(): Token; + /** + * returns list of `MechanismInfo` + */ + getMechanisms(): MechanismCollection; + /** + * initializes a token + * @param {string} pin the SO's initial PIN + * @param {string} label label of the token + */ + initToken(pin: string, label: string): void; + /** + * opens a session between an application and a token in a particular slot + * @parsm flags indicates the type of session + */ + open(flags?: number): Session; + /** + * closes all sessions an application has with a token + */ + closeAll(): void; + } + + class SlotCollection extends Collection { + module: Module; + items(index: number): Slot; + constructor(items: Array, module: Module, lib: Pkcs11, classType?: any); + } + + class Module extends BaseObject implements IModuleInfo { + libFile: string; + libName: string; + /** + * Cryptoki interface version + */ + cryptokiVersion: IVersion; + /** + * blank padded manufacturer ID + */ + manufacturerID: string; + /** + * must be zero + */ + flags: number; + /** + * blank padded library description + */ + libraryDescription: string; + /** + * version of library + */ + libraryVersion: IVersion; + constructor(lib: Pkcs11); + protected getInfo(): void; + /** + * initializes the Cryptoki library + */ + initialize(): void; + /** + * indicates that an application is done with the Cryptoki library + */ + finalize(): void; + /** + * obtains a list of slots in the system + * @param {number} index index of an element in collection + * @param {number} tokenPresent only slots with tokens. Default `True` + */ + getSlots(index: number, tokenPresent?: boolean): Slot; + /** + * @param {number} tokenPresent only slots with tokens. Default `True` + */ + getSlots(tokenPresent?: boolean): SlotCollection; + /** + * loads pkcs11 lib + */ + static load(libFile: string, libName?: string): Module; + } + + class Cipher { + session: Session; + lib: Pkcs11; + constructor(session: Session, alg: MechanismType, key: Key, lib: Pkcs11); + protected init(alg: MechanismType, key: Key): void; + update(text: string): Buffer; + update(data: Buffer): Buffer; + final(): Buffer; + } + + class Decipher { + session: Session; + lib: Pkcs11; + constructor(session: Session, alg: MechanismType, key: Key, lib: Pkcs11); + protected init(alg: MechanismType, key: Key): void; + update(text: string): Buffer; + update(data: Buffer): Buffer; + final(): Buffer; + } + + class Digest { + session: Session; + lib: Pkcs11; + constructor(session: Session, alg: MechanismType, lib: Pkcs11); + protected init(alg: MechanismType): void; + update(text: string): void; + update(data: Buffer): void; + final(): Buffer; + } + + class Sign { + session: Session; + lib: Pkcs11; + constructor(session: Session, alg: MechanismType, key: Key, lib: Pkcs11); + protected init(alg: MechanismType, key: Key): void; + update(text: string): void; + update(data: Buffer): void; + final(): Buffer; + } + + class Verify { + session: Session; + lib: Pkcs11; + constructor(session: Session, alg: MechanismType, key: Key, lib: Pkcs11); + protected init(alg: MechanismType, key: Key): void; + update(text: string): void; + update(data: Buffer): void; + final(signature: Buffer): boolean; + } + + /** + * + * EC + * + */ + + /** + * EcKdf is used to indicate the Key Derivation Function (KDF) + * applied to derive keying data from a shared secret. + * The key derivation function will be used by the EC key agreement schemes. + */ + enum EcKdf { + NULL, + SHA1, + SHA224, + SHA256, + SHA384, + SHA512, + } + + class EcdhParams implements IParams { + /** + * key derivation function used on the shared secret value + */ + kdf: EcKdf; + /** + * some data shared between the two parties + */ + sharedData: Buffer; + /** + * other party's EC public key value + */ + publicData: Buffer; + /** + * @param {EcKdf} kdf key derivation function used on the shared secret value + * @param {Buffer=null} sharedData some data shared between the two parties + * @param {Buffer=null} publicData other party's EC public key value + */ + constructor(kdf: EcKdf, sharedData?: Buffer, publicData?: Buffer); + toCKI(): Buffer; + } + + export interface INamedCurve { + name: string; + oid: string; + value: Buffer; + size: number; + } + + class NamedCurve { + static getByName(name: string): INamedCurve; + static getByOid(oid: string): INamedCurve; + } + + /** + * + * AES + * + */ + + class AesCbcParams implements IParams { + /** + * initialization vector + * - must have a fixed size of 16 bytes + */ + iv: Buffer; + /** + * the data + */ + data: Buffer; + constructor(iv: Buffer, data: Buffer); + toCKI(): Buffer; + } + + class AesCcmParams implements IParams { + /** + * length of the data where 0 <= dataLength < 2^8L + */ + dataLength: number; + /** + * the nonce + */ + nonce: Buffer; + /** + * the additional authentication data + * - This data is authenticated but not encrypted + */ + aad: Buffer; + /** + * length of authentication tag (output following cipher text) in bits. + * - Can be any value between 0 and 128 + */ + macLength: number; + constructor(dataLength: number, nonce: Buffer, aad?: Buffer, macLength?: number); + toCKI(): Buffer; + } + + class AesGcmParams implements IParams { + /** + * initialization vector + * - The length of the initialization vector can be any number between 1 and 256. + * 96-bit (12 byte) IV values can be processed more efficiently, + * so that length is recommended for situations in which efficiency is critical. + */ + iv: Buffer; + /** + * pointer to additional authentication data. + * This data is authenticated but not encrypted. + */ + aad: Buffer; + /** + * length of authentication tag (output following cipher text) in bits. + * Can be any value between 0 and 128. Default 128 + */ + tagBits: number; + constructor(iv: Buffer, aad?: Buffer, tagBits?: number); + toCKI(): Buffer; + } + + /** + * + * RSA + * + */ + + enum RsaMgf { + MGF1_SHA1, + MGF1_SHA224, + MGF1_SHA256, + MGF1_SHA384, + MGF1_SHA512, + } + + class RsaOaepParams implements IParams { + hashAlgorithm: MechanismEnum; + mgf: RsaMgf; + source: number; + sourceData: Buffer; + constructor(hashAlg?: MechanismEnum, mgf?: RsaMgf, sourceData?: Buffer); + toCKI(): Buffer; + } + + class RsaPssParams implements IParams { + /** + * hash algorithm used in the PSS encoding; + * - if the signature mechanism does not include message hashing, + * then this value must be the mechanism used by the application to generate + * the message hash; + * - if the signature mechanism includes hashing, + * then this value must match the hash algorithm indicated + * by the signature mechanism + */ + hashAlgorithm: MechanismEnum; + /** + * mask generation function to use on the encoded block + */ + mgf: RsaMgf; + /** + * length, in bytes, of the salt value used in the PSS encoding; + * - typical values are the length of the message hash and zero + */ + saltLength: number; + constructor(hashAlg?: MechanismEnum, mgf?: RsaMgf, saltLen?: number); + toCKI(): Buffer; + } + +} \ No newline at end of file diff --git a/inflected/inflected-tests.ts b/inflected/inflected-tests.ts new file mode 100644 index 000000000..05a54a5d0 --- /dev/null +++ b/inflected/inflected-tests.ts @@ -0,0 +1,48 @@ +/// + +import * as Inflector from "inflected"; + +Inflector.pluralize("Category"); +Inflector.singularize("Categories"); +Inflector.camelize("nerd_bar", false); +Inflector.underscore('FooBar') // => 'foo_bar' +//Inflector.humanize('employee_salary') // => 'Employee salary' +//Inflector.humanize('author_id') // => 'Author' +Inflector.humanize('author_id', { capitalize: false }) // => 'author' + +Inflector.titleize('man from the boondocks') // => 'Man From The Boondocks' +Inflector.titleize('x-men: the last stand') // => 'X Men: The Last Stand' +Inflector.titleize('TheManWithoutAPast') // => 'The Man Without A Past' +Inflector.titleize('raiders_of_the_lost_ark') // => 'Raiders Of The Lost Ark' + +Inflector.tableize('RawScaledScorer') // => 'raw_scaled_scorers' +Inflector.tableize('egg_and_ham') // => 'egg_and_hams' +Inflector.tableize('fancyCategory') // => 'fancy_categories' + +Inflector.classify('egg_and_hams') // => 'EggAndHam' +Inflector.classify('posts') // => 'Post' + +Inflector.dasherize('puni_puni') // => 'puni-puni' + +Inflector.foreignKey('Message') // => 'message_id' +Inflector.foreignKey('Message', false) // => 'messageid' + +Inflector.ordinal(1) // => 'st' +Inflector.ordinal(2) // => 'nd' +Inflector.ordinal(1002) // => 'nd' +Inflector.ordinal(1003) // => 'rd' +Inflector.ordinal(-11) // => 'th' +Inflector.ordinal(-1021) // => 'st' + +Inflector.ordinalize(1) // => '1st' +Inflector.ordinalize(2) // => '2nd' +Inflector.ordinalize(1002) // => '1002nd' +Inflector.ordinalize(1003) // => '1003rd' +Inflector.ordinalize(-11) // => '-11th' +Inflector.ordinalize(-1021) // => '-1021st' + +Inflector.transliterate('Ærøskøbing') // => 'AEroskobing' + +Inflector.parameterize('Donald E. Knuth') // => 'donald-e-knuth' +Inflector.parameterize('Donald E. Knuth', { separator: '+' }) // => 'donald+e+knuth' + diff --git a/inflected/inflected.d.ts b/inflected/inflected.d.ts new file mode 100644 index 000000000..49a72ef3c --- /dev/null +++ b/inflected/inflected.d.ts @@ -0,0 +1,44 @@ +// Type definitions for inflected 1.1.6 +// Project: https://github.com/martinandert/inflected +// Definitions by: Daniel Schmidt +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "inflected" { + + module Options { + interface Humanize { + capitalize: boolean; + } + + interface Transliterate { + locale: string; + replacement: string; + } + + interface Parameterize { + separator: string; + } + } + + interface Inflected { + pluralize(word: string, locale?: string): string; + singularize(word: string, locale?: string): string; + camelize(term: string, uppercaseFirstLetter?: boolean): string; + underscore(camelCaseWord: string): string; + humanize(lowerCaseAndUnderscoredWord: string, + options?: Options.Humanize): string; + titleize(sentence: string): string; + tableize(className: string): string; + classify(tableName: string): string; + dasherize(underscoredWord: string): string; + foreignKey(className: string, + separateClassNameAndIdWithUnderscore?:boolean): string; + ordinal(number: number): string; + ordinalize(number: number): string; + transliterate(sentence: string, options?: Options.Transliterate): string; + parameterize(sentence: string, options?: Options.Parameterize): string; + } + + var Inflector:Inflected; + export = Inflector; +} \ No newline at end of file diff --git a/intro.js/intro.js-tests.ts b/intro.js/intro.js-tests.ts index 0ec5938f5..a3e5c0e4d 100644 --- a/intro.js/intro.js-tests.ts +++ b/intro.js/intro.js-tests.ts @@ -1,6 +1,8 @@ /// var intro = introJs(); +var introWithElement = introJs(document.body); +var introWithQuerySelector = introJs('body'); intro.setOption('doneLabel', 'Next page'); intro.setOption('overlayOpacity', 50); @@ -48,9 +50,31 @@ intro.start() .onafterchange(function (element) { element.getAttribute('class'); }) - .onchange(function () { - alert('Changed'); + .onchange(function (element) { + element.getAttribute('class'); }) .oncomplete(function () { alert('Done'); - }); + }) + .onexit(function () { + alert('Exiting'); + }) + .onhintsadded(function () { + alert('Hints added'); + }) + .onhintclick(function (hintElement, item, stepId) { + hintElement.getAttribute('class'); + }) + .onhintclose(function (stepId) { + alert('Hint close for Step ID ' + stepId); + }) + .addHints() + .clone(); + +introWithElement.start() + .exit() + .clone(); + +introWithQuerySelector.start() + .exit() + .clone(); diff --git a/intro.js/intro.js.d.ts b/intro.js/intro.js.d.ts index 6763124ba..b476d5793 100644 --- a/intro.js/intro.js.d.ts +++ b/intro.js/intro.js.d.ts @@ -1,4 +1,4 @@ -// Type definitions for intro.js 1.1.1 +// Type definitions for intro.js 2.0 // Project: https://github.com/usablica/intro.js // Definitions by: Maxime Fabre // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -29,12 +29,15 @@ declare module IntroJs { overlayOpacity?: number; positionPrecedence?: string[]; disableInteraction?: boolean; - steps: Step[]; + hintPosition?: string; + hintButtonLabel?: string; + steps?: Step[]; } interface IntroJs { start(): IntroJs; exit(): IntroJs; + clone(): IntroJs; goToStep(step: number): IntroJs; nextStep(): IntroJs; @@ -48,12 +51,20 @@ declare module IntroJs { onexit(callback: Function): IntroJs; onbeforechange(callback: (element: HTMLElement) => any): IntroJs; onafterchange(callback: (element: HTMLElement) => any): IntroJs; - onchange(callback: Function): IntroJs; + onchange(callback: (element: HTMLElement) => any): IntroJs; oncomplete(callback: Function): IntroJs; + + addHints(): IntroJs; + + onhintsadded(callback: Function): IntroJs; + onhintclick(callback: (hintElement: HTMLElement, item: Step, stepId: number) => any): IntroJs; + onhintclose(callback: (stepId: number) => any): IntroJs; } interface Factory { - (element?: string): IntroJs; + (): IntroJs; + (element: HTMLElement): IntroJs; + (querySelector: string): IntroJs; } } diff --git a/jsmockito/jsmockito-tests.ts b/jsmockito/jsmockito-tests.ts index 3b12ffba5..461f82982 100644 --- a/jsmockito/jsmockito-tests.ts +++ b/jsmockito/jsmockito-tests.ts @@ -33,6 +33,7 @@ function test_JsMockito_when() { } function test_JsMockito_verify() { + JsMockito.verify(new TestClass()).test(); JsMockito.verify(new TestClass(), new TestVerifier()).test(); } @@ -129,6 +130,7 @@ function test_when() { } function test_verify() { + verify(new TestClass()).test(); verify(new TestClass(), new TestVerifier()).test(); } diff --git a/jsmockito/jsmockito.d.ts b/jsmockito/jsmockito.d.ts index 401cb9f93..2763cb6e6 100644 --- a/jsmockito/jsmockito.d.ts +++ b/jsmockito/jsmockito.d.ts @@ -378,6 +378,7 @@ declare module JsMockito { * @param verifier Optional JsMockito.Verifier instance (default: JsMockito.Verifiers.once()) * @return {T} A verifier on which the method or function to be verified can be invoked */ + export function verify(mock: T): T; export function verify(mock: T, verifier: Verifier): T; /** @@ -587,6 +588,7 @@ declare function when(mock: T): T; * @param verifier Optional JsMockito.Verifier instance (default: JsMockito.Verifiers.once()) * @return {T} A verifier on which the method or function to be verified can be invoked */ +declare function verify(mock: T): T; declare function verify(mock: T, verifier: JsMockito.Verifier): T; /** diff --git a/jsonwebtoken/jsonwebtoken.d.ts b/jsonwebtoken/jsonwebtoken.d.ts index a047acf95..75839b2d9 100644 --- a/jsonwebtoken/jsonwebtoken.d.ts +++ b/jsonwebtoken/jsonwebtoken.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jsonwebtoken 0.4.0 +// Type definitions for jsonwebtoken 5.7.0 // Project: https://github.com/auth0/node-jsonwebtoken // Definitions by: Maxime LUCE , Daniel Heim // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -22,17 +22,20 @@ declare module "jsonwebtoken" { * - none: No digital signature or MAC value included */ algorithm?: string; - /** + /** *@deprecated - see expiresIn - *@member {number} - Lifetime for the token in minutes + *@member {number} - Lifetime for the token in minutes */ expiresInMinutes?: number; /** @member {string} - Lifetime for the token expressed in a string describing a time span [rauchg/ms](https://github.com/rauchg/ms.js). Eg: `60`, `"2 days"`, `"10h"`, `"7d"` */ expiresIn?: string; + notBefore?: string; audience?: string; subject?: string; issuer?: string; + jwtid?: string; noTimestamp?: boolean; + headers?: Object; } export interface VerifyOptions { @@ -40,6 +43,12 @@ declare module "jsonwebtoken" { audience?: string; issuer?: string; ignoreExpiration?: boolean; + ignoreNotBefore?: boolean; + subject?: string; + /** + *@deprecated + *@member {string} - Max age of token + */ maxAge?: string; } @@ -74,7 +83,7 @@ declare module "jsonwebtoken" { */ export function sign(payload: string | Buffer | Object, secretOrPrivateKey: string | Buffer, callback: SignCallback): void; export function sign(payload: string | Buffer | Object, secretOrPrivateKey: string | Buffer, options: SignOptions, callback: SignCallback): void; - + /** * Synchronously verify given token using a secret or a public key to get a decoded token * @param {String} token - JWT string to verify diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index a172f7498..903497617 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -18284,3 +18284,6 @@ declare module _ { declare module "lodash" { export = _; } + +// Backward compatibility with --target es5 +interface Map {} diff --git a/material-ui/legacy/material-ui-0.13.4-tests.tsx b/material-ui/legacy/material-ui-0.13.4-tests.tsx new file mode 100644 index 000000000..76a1f0d81 --- /dev/null +++ b/material-ui/legacy/material-ui-0.13.4-tests.tsx @@ -0,0 +1,534 @@ +/// +/// +/// + +import * as React from "react"; +import * as LinkedStateMixin from "react-addons-linked-state-mixin"; +import Checkbox = require("material-ui/lib/checkbox"); +import Colors = require("material-ui/lib/styles/colors"); +import Spacing = require("material-ui/lib/styles/spacing"); +import AppBar = require("material-ui/lib/app-bar"); +import Badge = require("material-ui/lib/badge"); +import IconButton = require("material-ui/lib/icon-button"); +import FlatButton = require("material-ui/lib/flat-button"); +import Avatar = require("material-ui/lib/avatar"); +import FontIcon = require("material-ui/lib/font-icon"); +import Typography = require("material-ui/lib/styles/typography"); +import RaisedButton = require("material-ui/lib/raised-button"); +import FloatingActionButton = require("material-ui/lib/floating-action-button"); +import Card = require("material-ui/lib/card/card"); +import CardHeader = require("material-ui/lib/card/card-header"); +import CardText = require("material-ui/lib/card/card-text"); +import CardActions = require("material-ui/lib/card/card-actions"); +import Dialog = require("material-ui/lib/dialog"); +import DropDownMenu = require("material-ui/lib/drop-down-menu"); +import DatePicker = require("material-ui/lib/date-picker/date-picker"); +import TimePicker = require("material-ui/lib/time-picker"); +import RadioButtonGroup = require("material-ui/lib/radio-button-group"); +import RadioButton = require("material-ui/lib/radio-button"); +import Toggle = require("material-ui/lib/toggle"); +import TextField = require("material-ui/lib/text-field"); +import SelectField = require("material-ui/lib/select-field"); +import IconMenu = require("material-ui/lib/menus/icon-menu"); +import Menu = require('material-ui/lib/menus/menu'); +import MenuItem = require('material-ui/lib/menus/menu-item'); +import MenuDivider = require('material-ui/lib/menus/menu-divider'); +import ThemeManager = require('material-ui/lib/styles/theme-manager'); +import GridList = require('material-ui/lib/grid-list/grid-list'); +import GridTile = require('material-ui/lib/grid-list/grid-tile'); + + +import NavigationClose = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/navigation/close", but they aren't defined yet. +import FileFolder = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/file/folder", but they aren't defined yet. +import ToggleStar = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/toggle/star", but they aren't defined yet. +import ActionGrade = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/action/grade", but they aren't defined yet. +import ToggleStarBorder = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/toggle/star-border", but they aren't defined yet. +import ArrowDropRight = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/toggle/star-border", but they aren't defined yet. + +type CheckboxProps = __MaterialUI.CheckboxProps; +type MuiTheme = __MaterialUI.Styles.MuiTheme; +type TouchTapEvent = __MaterialUI.TouchTapEvent; + +interface MaterialUiTestsState { + showDialogStandardActions: boolean; + showDialogCustomActions: boolean; + showDialogScrollable: boolean; +} + +class MaterialUiTests extends React.Component<{}, MaterialUiTestsState> implements React.LinkedStateMixin { + + // injected with mixin + linkState: (key: string) => React.ReactLink; + dialog: Dialog; + + private touchTapEventHandler(e: TouchTapEvent) { + this.dialog.show(); + } + private formEventHandler(e: React.FormEvent) { + } + private selectFieldChangeHandler(e: TouchTapEvent, si: number, mi: any) { + } + private handleRequestClose(buttonClicked: boolean) { + } + + render() { + + // "http://material-ui.com/#/customization/themes" + let muiTheme: MuiTheme = ThemeManager.getMuiTheme({ + palette: { + accent1Color: Colors.cyan100 + }, + spacing: { + + } + }); + + // "http://material-ui.com/#/customization/inline-styles" + let element: React.ReactElement; + element = + element = React.createElement(Checkbox, { + id: "checkboxId1", name: "checkboxName1", value: "checkboxValue1", label: "went for a run today", style: { + width: '50%', + margin: '0 auto' + }, iconStyle: { + fill: '#FF4081' + } + }); + + // "http://material-ui.com/#/components/appbar" + element = + element = } + iconElementRight={} />; + + // "http://material-ui.com/#/components/avatars" + //image avatar + element = ; + //SvgIcon avatar + element = } />; + //SvgIcon avatar with custom colors + element = } + color={Colors.orange200} + backgroundColor={Colors.pink400} />; + //FontIcon avatar + element = + } />; + //FontIcon avatar with custom colors + element = } + color={Colors.blue300} + backgroundColor={Colors.indigo900} />; + //Letter avatar + element = A; + //Letter avatar with custom colors + element = + + + // "http://material-ui.com/#/components/badge" + element = Hello}> + + ; + element = Hello} + badgeStyle={{height: '24px', width: '24px'}} + > + This text has a badge! + ; + + // "http://material-ui.com/#/components/buttons" + element = + + ; + element = + + ; + element = + + ; + + // "http://material-ui.com/#/components/cards" + element = + A} + showExpandableButton={true}> + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + + + + + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + + ; + + // "http://material-ui.com/#/components/date-picker" + element = ; + element = ; + element = ; + + // "http://material-ui.com/#/components/time-picker" + element = + + // "http://material-ui.com/#/components/dialog" + let standardActions = [ + { text: 'Cancel' }, + { text: 'Submit', onTouchTap: this.touchTapEventHandler, ref: 'submit' } + ]; + + element = + The actions in this window are created from the json that's passed in. + ; + + //Custom Actions + let customActions = [ + , + + ]; + + element = + The actions in this window were passed in as an array of react objects. + ; + + element = +
+ Really long content +
+
; + + + // "http://material-ui.com/#/components/dropdown-menu" + let menuItems = [ + { payload: '1', text: 'Never' }, + { payload: '2', text: 'Every Night' }, + { payload: '3', text: 'Weeknights' }, + { payload: '4', text: 'Weekends' }, + { payload: '5', text: 'Weekly' }, + ]; + element = ; + + // "http://material-ui.com/#/components/icons" + element = home; + + // "http://material-ui.com/#/components/icon-buttons" + //Method 1: muidocs-icon-github is defined in a style sheet. + element = ; + //Method 2: ActionGrade is a component created using mui.SvgIcon. + element = + + ; + //Method 3: Manually creating a mui.FontIcon component within IconButton + element = + + ; + //Method 4: Using Google material-icons + element = settings_system_daydream; + + // "http://material-ui.com/#/components/icon-menus" + element = }> + + + + + + ; + + // "http://material-ui.com/#/components/left-nav" + + + // "http://material-ui.com/#/components/lists" + + + // "http://material-ui.com/#/components/menus" + element = + + + + + ; + element = + + + + + + + + } /> + } /> + } /> + } /> + } /> + + + ; + + // "http://material-ui.com/#/components/paper" + + + // "http://material-ui.com/#/components/progress" + + + // "http://material-ui.com/#/components/refresh-indicator" + + + // "http://material-ui.com/#/components/sliders" + + + // "http://material-ui.com/#/components/switches" + element = ; + element = ; + element = } + unCheckedIcon={} + label="custom icon" />; + + element = + ; + ; + + ; + + element = ; + + element = ; + + element = ; + + // "http://material-ui.com/#/components/snackbar" + + + // "http://material-ui.com/#/components/table" + + + // "http://material-ui.com/#/components/tabs" + + + // "http://material-ui.com/#/components/text-fields" + element = ; + element = ; + element = ; + element = ; + element = ('valueLinkValue') } />; + element = ; + element = ; + element = ; + element = ; + element = ; + element = ; + element = ; + + //Select Fields + let arbitraryArrayMenuItems = [ + { + id: 0, + name: "zero", + }, + ]; + element = ; + element = ; + element = ; + element = ; + + //Floating Hint Text Labels + element = ; + element = ; + element = ; + element = ('floatingValueLinkValue') } />; + element = ; + element = ; + element = ; + element = ; + element = ; + element = ; + + + // "http://material-ui.com/#/components/time-picker" + + + // "http://material-ui.com/#/components/toolbars" + + // "http://material-ui.com/#/components/grid-list" + element = ; + + element = GridTile} + actionPosition="left" + titlePosition="top" + titleBackground="rgba(0, 0, 0, 0.4)" + cols={2} + rows={1} + style={{ color: 'red' }}> +

Children are Required!

+
; + + return element; + } +} diff --git a/material-ui/legacy/material-ui-0.13.4.d.ts b/material-ui/legacy/material-ui-0.13.4.d.ts new file mode 100644 index 000000000..ce400f990 --- /dev/null +++ b/material-ui/legacy/material-ui-0.13.4.d.ts @@ -0,0 +1,3283 @@ +// Type definitions for material-ui v0.13.4 +// Project: https://github.com/callemall/material-ui +// Definitions by: Nathan Brown , Oliver Herrmann +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "material-ui" { + export import AppBar = __MaterialUI.AppBar; // require('material-ui/lib/app-bar'); + export import AppCanvas = __MaterialUI.AppCanvas; // require('material-ui/lib/app-canvas'); + export import Avatar = __MaterialUI.Avatar; // require('material-ui/lib/avatar'); + export import Badge = __MaterialUI.Badge; // require('material-ui/lib/badge'); + export import BeforeAfterWrapper = __MaterialUI.BeforeAfterWrapper; // require('material-ui/lib/before-after-wrapper'); + export import Card = __MaterialUI.Card.Card; // require('material-ui/lib/card/card'); + export import CardActions = __MaterialUI.Card.CardActions; // require('material-ui/lib/card/card-actions'); + export import CardExpandable = __MaterialUI.Card.CardExpandable; // require('material-ui/lib/card/card-expandable'); + export import CardHeader = __MaterialUI.Card.CardHeader; // require('material-ui/lib/card/card-header'); + export import CardMedia = __MaterialUI.Card.CardMedia; // require('material-ui/lib/card/card-media'); + export import CardText = __MaterialUI.Card.CardText; // require('material-ui/lib/card/card-text'); + export import CardTitle = __MaterialUI.Card.CardTitle; // require('material-ui/lib/card/card-title'); + export import Checkbox = __MaterialUI.Checkbox; // require('material-ui/lib/checkbox'); + export import CircularProgress = __MaterialUI.CircularProgress; // require('material-ui/lib/circular-progress'); + export import ClearFix = __MaterialUI.ClearFix; // require('material-ui/lib/clearfix'); + export import DatePicker = __MaterialUI.DatePicker.DatePicker; // require('material-ui/lib/date-picker/date-picker'); + export import DatePickerDialog = __MaterialUI.DatePicker.DatePickerDialog; // require('material-ui/lib/date-picker/date-picker-dialog'); + export import Dialog = __MaterialUI.Dialog // require('material-ui/lib/dialog'); + export import DropDownIcon = __MaterialUI.DropDownIcon; // require('material-ui/lib/drop-down-icon'); + export import DropDownMenu = __MaterialUI.DropDownMenu; // require('material-ui/lib/drop-down-menu'); + export import EnhancedButton = __MaterialUI.EnhancedButton; // require('material-ui/lib/enhanced-button'); + export import FlatButton = __MaterialUI.FlatButton; // require('material-ui/lib/flat-button'); + export import FloatingActionButton = __MaterialUI.FloatingActionButton; // require('material-ui/lib/floating-action-button'); + export import FontIcon = __MaterialUI.FontIcon; // require('material-ui/lib/font-icon'); + export import IconButton = __MaterialUI.IconButton; // require('material-ui/lib/icon-button'); + export import IconMenu = __MaterialUI.Menus.IconMenu; // require('material-ui/lib/menus/icon-menu'); + export import LeftNav = __MaterialUI.LeftNav; // require('material-ui/lib/left-nav'); + export import LinearProgress = __MaterialUI.LinearProgress; // require('material-ui/lib/linear-progress'); + export import List = __MaterialUI.Lists.List; // require('material-ui/lib/lists/list'); + export import ListDivider = __MaterialUI.Lists.ListDivider; // require('material-ui/lib/lists/list-divider'); + export import ListItem = __MaterialUI.Lists.ListItem; // require('material-ui/lib/lists/list-item'); + export import Menu = __MaterialUI.Menu.Menu; // require('material-ui/lib/menu/menu'); + export import MenuItem = __MaterialUI.Menu.MenuItem; // require('material-ui/lib/menu/menu-item'); + export import Mixins = __MaterialUI.Mixins; // require('material-ui/lib/mixins/'); + export import Overlay = __MaterialUI.Overlay; // require('material-ui/lib/overlay'); + export import Paper = __MaterialUI.Paper; // require('material-ui/lib/paper'); + export import RadioButton = __MaterialUI.RadioButton; // require('material-ui/lib/radio-button'); + export import RadioButtonGroup = __MaterialUI.RadioButtonGroup; // require('material-ui/lib/radio-button-group'); + export import RaisedButton = __MaterialUI.RaisedButton; // require('material-ui/lib/raised-button'); + export import RefreshIndicator = __MaterialUI.RefreshIndicator; // require('material-ui/lib/refresh-indicator'); + export import Ripples = __MaterialUI.Ripples; // require('material-ui/lib/ripples/'); + export import SelectField = __MaterialUI.SelectField; // require('material-ui/lib/select-field'); + export import Slider = __MaterialUI.Slider; // require('material-ui/lib/slider'); + export import SvgIcon = __MaterialUI.SvgIcon; // require('material-ui/lib/svg-icon'); + export import Icons = __MaterialUI.Icons; + export import Styles = __MaterialUI.Styles; // require('material-ui/lib/styles/'); + export import Snackbar = __MaterialUI.Snackbar; // require('material-ui/lib/snackbar'); + export import Tab = __MaterialUI.Tabs.Tab; // require('material-ui/lib/tabs/tab'); + export import Tabs = __MaterialUI.Tabs.Tabs; // require('material-ui/lib/tabs/tabs'); + export import Table = __MaterialUI.Table.Table; // require('material-ui/lib/table/table'); + export import TableBody = __MaterialUI.Table.TableBody; // require('material-ui/lib/table/table-body'); + export import TableFooter = __MaterialUI.Table.TableFooter; // require('material-ui/lib/table/table-footer'); + export import TableHeader = __MaterialUI.Table.TableHeader; // require('material-ui/lib/table/table-header'); + export import TableHeaderColumn = __MaterialUI.Table.TableHeaderColumn; // require('material-ui/lib/table/table-header-column'); + export import TableRow = __MaterialUI.Table.TableRow; // require('material-ui/lib/table/table-row'); + export import TableRowColumn = __MaterialUI.Table.TableRowColumn; // require('material-ui/lib/table/table-row-column'); + export import ThemeWrapper = __MaterialUI.ThemeWrapper; // require('material-ui/lib/theme-wrapper'); + export import Toggle = __MaterialUI.Toggle; // require('material-ui/lib/toggle'); + export import TimePicker = __MaterialUI.TimePicker; // require('material-ui/lib/time-picker'); + export import TextField = __MaterialUI.TextField; // require('material-ui/lib/text-field'); + export import Toolbar = __MaterialUI.Toolbar.Toolbar; // require('material-ui/lib/toolbar/toolbar'); + export import ToolbarGroup = __MaterialUI.Toolbar.ToolbarGroup; // require('material-ui/lib/toolbar/toolbar-group'); + export import ToolbarSeparator = __MaterialUI.Toolbar.ToolbarSeparator; // require('material-ui/lib/toolbar/toolbar-separator'); + export import ToolbarTitle = __MaterialUI.Toolbar.ToolbarTitle; // require('material-ui/lib/toolbar/toolbar-title'); + export import Tooltip = __MaterialUI.Tooltip; // require('material-ui/lib/tooltip'); + export import Utils = __MaterialUI.Utils; // require('material-ui/lib/utils/'); + + export import GridList = __MaterialUI.GridList.GridList; // require('material-ui/lib/gridlist/grid-list'); + export import GridTile = __MaterialUI.GridList.GridTile; // require('material-ui/lib/gridlist/grid-tile'); + + // export type definitions + export type TouchTapEvent = __MaterialUI.TouchTapEvent; + export type TouchTapEventHandler = __MaterialUI.TouchTapEventHandler; + export type DialogAction = __MaterialUI.DialogAction; +} + +declare namespace __MaterialUI { + import React = __React; + + // ReactLink is from "react/addons" + interface ReactLink { + value: T; + requestChange(newValue: T): void; + } + + // What's common between React.TouchEvent and React.MouseEvent + interface TouchTapEvent extends React.SyntheticEvent { + altKey: boolean; + ctrlKey: boolean; + getModifierState(key: string): boolean; + metaKey: boolean; + shiftKey: boolean; + } + + // What's common between React.TouchEventHandler and React.MouseEventHandler + interface TouchTapEventHandler extends React.EventHandler { } + + // more specific than React.HTMLAttributes + + interface AppBarProps extends React.Props { + iconClassNameLeft?: string; + iconClassNameRight?: string; + iconElementLeft?: React.ReactElement; + iconElementRight?: React.ReactElement; + iconStyleRight?: string; + style?: React.CSSProperties; + showMenuIconButton?: boolean; + title?: React.ReactNode; + zDepth?: number; + + onLeftIconButtonTouchTap?: TouchTapEventHandler; + onRightIconButtonTouchTap?: TouchTapEventHandler; + } + export class AppBar extends React.Component{ + } + + interface AppCanvasProps extends React.Props { + style?: React.CSSProperties; + } + export class AppCanvas extends React.Component { + } + + interface AvatarProps extends React.Props { + icon?: React.ReactElement; + backgroundColor?: string; + color?: string; + size?: number; + src?: string; + style?: React.CSSProperties; + } + export class Avatar extends React.Component { + } + + interface BadgeProps extends React.Props { + badgeContent: React.ReactElement | string | number; + primary?: boolean; + secondary?: boolean; + style?: React.CSSProperties; + badgeStyle?: React.CSSProperties; + } + export class Badge extends React.Component { + } + + interface BeforeAfterWrapperProps extends React.Props { + beforeStyle?: React.CSSProperties; + afterStyle?: React.CSSProperties; + beforeElementType?: string; + afterElementType?: string; + elementType?: string; + } + export class BeforeAfterWrapper extends React.Component { + } + + namespace Card { + + interface CardProps extends React.Props { + expandable?: boolean; + initiallyExpanded?: boolean; + onExpandedChange?: (isExpanded: boolean) => void; + style?: React.CSSProperties; + } + export class Card extends React.Component { + } + + interface CardActionsProps extends React.Props { + expandable?: boolean; + showExpandableButton?: boolean; + style?: React.CSSProperties; + } + export class CardActions extends React.Component { + } + + interface CardExpandableProps extends React.Props { + onExpanding?: (isExpanded: boolean) => void; + expanded?: boolean; + style?: React.CSSProperties; + } + export class CardExpandable extends React.Component { + } + + interface CardHeaderProps extends React.Props { + expandable?: boolean; + showExpandableButton?: boolean; + title?: string | React.ReactElement; + titleColor?: string; + titleStyle?: React.CSSProperties; + subtitle?: string | React.ReactElement; + subtitleColor?: string; + subtitleStyle?: React.CSSProperties; + textStyle?: React.CSSProperties; + style?: React.CSSProperties; + avatar: React.ReactElement | string; + } + export class CardHeader extends React.Component { + } + + interface CardMediaProps extends React.Props { + expandable?: boolean; + overlay?: React.ReactNode; + overlayStyle?: React.CSSProperties; + overlayContainerStyle?: React.CSSProperties; + overlayContentStyle?: React.CSSProperties; + mediaStyle?: React.CSSProperties; + style?: React.CSSProperties; + } + export class CardMedia extends React.Component { + } + + interface CardTextProps extends React.Props { + expandable?: boolean; + color?: string; + style?: React.CSSProperties; + } + export class CardText extends React.Component { + } + + interface CardTitleProps extends React.Props { + expandable?: boolean; + showExpandableButton?: boolean; + title?: string | React.ReactElement; + titleColor?: string; + titleStyle?: React.CSSProperties; + subtitle?: string | React.ReactElement; + subtitleColor?: string; + subtitleStyle?: React.CSSProperties; + textStyle?: React.CSSProperties; + style?: React.CSSProperties; + } + export class CardTitle extends React.Component { + } + } + + // what's not commonly overridden by Checkbox, RadioButton, or Toggle + interface CommonEnhancedSwitchProps extends React.HTMLAttributes, React.Props { + // is root element + id?: string; + iconStyle?: React.CSSProperties; + labelStyle?: React.CSSProperties; + rippleStyle?: React.CSSProperties; + thumbStyle?: React.CSSProperties; + trackStyle?: React.CSSProperties; + name?: string; + value?: string; + label?: string; + required?: boolean; + disabled?: boolean; + defaultSwitched?: boolean; + disableFocusRipple?: boolean; + disableTouchRipple?: boolean; + } + + interface EnhancedSwitchProps extends CommonEnhancedSwitchProps { + // is root element + inputType: string; + switchElement: React.ReactElement; + onParentShouldUpdate: (isInputChecked: boolean) => void; + switched: boolean; + rippleColor?: string; + onSwitch?: (e: React.MouseEvent, isInputChecked: boolean) => void; + labelPosition?: string; + } + export class EnhancedSwitch extends React.Component { + isSwitched(): boolean; + setSwitched(newSwitchedValue: boolean): void; + getValue(): any; + isKeyboardFocused(): boolean; + } + + interface CheckboxProps extends CommonEnhancedSwitchProps { + // is root element + checkedIcon?: React.ReactElement<{ style?: React.CSSProperties }>; // Normally an SvgIcon + defaultChecked?: boolean; + iconStyle?: React.CSSProperties; + label?: string; + labelStyle?: React.CSSProperties; + labelPosition?: string; + style?: React.CSSProperties; + checked?: boolean; + unCheckedIcon?: React.ReactElement<{ style?: React.CSSProperties }>; // Normally an SvgIcon + + disabled?: boolean; + valueLink?: ReactLink; + checkedLink?: ReactLink; + + onCheck?: (event: React.MouseEvent, checked: boolean) => void; + } + export class Checkbox extends React.Component { + isChecked(): void; + setChecked(newCheckedValue: boolean): void; + } + + interface CircularProgressProps extends React.Props { + mode?: string; + value?: number; + min?: number; + max?: number; + size?: number; + color?: string; + innerStyle?: React.CSSProperties; + style?: React.CSSProperties; + + } + export class CircularProgress extends React.Component { + } + + interface ClearFixProps extends React.Props { + } + export class ClearFix extends React.Component { + } + + namespace DatePicker { + interface DatePickerProps extends React.Props { + autoOk?: boolean; + defaultDate?: Date; + formatDate?: (date:Date) => string; + hintText?: string; + floatingLabelText?: string; + hideToolbarYearChange?: boolean; + maxDate?: Date; + minDate?: Date; + mode?: string; + onDismiss?: () => void; + + // e is always null + onChange?: (e: any, d: Date) => void; + + onFocus?: React.FocusEventHandler; + onShow?: () => void; + onTouchTap?: React.TouchEventHandler; + shouldDisableDate?: (day: Date) => boolean; + showYearSelector?: boolean; + style?: React.CSSProperties; + textFieldStyle?: React.CSSProperties; + } + export class DatePicker extends React.Component { + } + + interface DatePickerDialogProps extends React.Props { + disableYearSelection?: boolean; + initialDate?: Date; + maxDate?: Date; + minDate?: Date; + onAccept?: (d: Date) => void; + onClickAway?: () => void; + onDismiss?: () => void; + onShow?: () => void; + shouldDisableDate?: (day: Date) => boolean; + showYearSelector?: boolean; + } + export class DatePickerDialog extends React.Component { + } + } + + export interface DialogAction { + id?: string; + text: string; + ref?: string; + + onTouchTap?: TouchTapEventHandler; + onClick?: React.MouseEventHandler; + } + interface DialogProps extends React.Props { + actions?: Array>; + actionFocus?: string; + autoDetectWindowHeight?: boolean; + autoScrollBodyContent?: boolean; + style?: React.CSSProperties; + bodyStyle?: React.CSSProperties; + contentClassName?: string; + contentInnerStyle?: React.CSSProperties; + contentStyle?: React.CSSProperties; + modal?: boolean; + openImmediately?: boolean; + repositionOnUpdate?: boolean; + title?: React.ReactNode; + defaultOpen?: boolean; + open?: boolean; + + onClickAway?: () => void; + onDismiss?: () => void; + onShow?: () => void; + onRequestClose?: (buttonClicked: boolean) => void; + } + export class Dialog extends React.Component { + dismiss(): void; + show(): void; + isOpen(): boolean; + } + + interface DropDownIconProps extends React.Props { + menuItems: Menu.MenuItemRequest[]; + closeOnMenuItemTouchTap?: boolean; + iconStyle?: React.CSSProperties; + iconClassName?: string; + iconLigature?: string; + + onChange?: Menu.ItemTapEventHandler; + } + export class DropDownIcon extends React.Component { + } + + interface DropDownMenuProps extends React.Props { + displayMember?: string; + valueMember?: string; + autoWidth?: boolean; + menuItems: Menu.MenuItemRequest[]; + menuItemStyle?: React.CSSProperties; + selectedIndex?: number; + underlineStyle?: React.CSSProperties; + iconStyle?: React.CSSProperties; + labelStyle?: React.CSSProperties; + style?: React.CSSProperties; + disabled?: boolean; + valueLink?: ReactLink; + value?: number; + + onChange?: Menu.ItemTapEventHandler; + } + export class DropDownMenu extends React.Component { + } + + // non generally overridden elements of EnhancedButton + interface SharedEnhancedButtonProps extends React.HTMLAttributes, React.Props { + centerRipple?: boolean; + containerElement?: string | React.ReactElement; + disabled?: boolean; + disableFocusRipple?: boolean; + disableKeyboardFocus?: boolean; + disableTouchRipple?: boolean; + keyboardFocused?: boolean; + linkButton?: boolean; + focusRippleColor?: string; + focusRippleOpacity?: number; + touchRippleOpacity?: number; + tabIndex?: number; + + onBlur?: React.FocusEventHandler; + onFocus?: React.FocusEventHandler; + onKeyboardFocus?: (e: React.FocusEvent, isKeyboardFocused: boolean) => void; + onKeyDown?: React.KeyboardEventHandler; + onKeyUp?: React.KeyboardEventHandler; + onMouseEnter?: React.MouseEventHandler; + onMouseLeave?: React.MouseEventHandler; + onTouchStart?: React.TouchEventHandler; + onTouchEnd?: React.TouchEventHandler; + onTouchTap?: TouchTapEventHandler; + } + + interface EnhancedButtonProps extends SharedEnhancedButtonProps { + touchRippleColor?: string; + focusRippleColor?: string; + style?: React.CSSProperties; + } + export class EnhancedButton extends React.Component { + } + + interface FlatButtonProps extends SharedEnhancedButtonProps { + hoverColor?: string; + label?: string; + labelPosition?: string; + labelStyle?: React.CSSProperties; + linkButton?: boolean; + primary?: boolean; + secondary?: boolean; + rippleColor?: string; + style?: React.CSSProperties; + } + export class FlatButton extends React.Component { + } + + interface FloatingActionButtonProps extends SharedEnhancedButtonProps { + backgroundColor?: string; + disabled?: boolean; + disabledColor?: string; + iconClassName?: string; + iconStyle?: React.CSSProperties; + mini?: boolean; + secondary?: boolean; + style?: React.CSSProperties; + } + export class FloatingActionButton extends React.Component { + } + + interface FontIconProps extends React.Props { + color?: string; + hoverColor?: string; + onMouseLeave?: React.MouseEventHandler; + onMouseEnter?: React.MouseEventHandler; + style?: React.CSSProperties; + className?: string; + } + export class FontIcon extends React.Component { + } + + interface IconButtonProps extends SharedEnhancedButtonProps { + iconClassName?: string; + iconStyle?: React.CSSProperties; + style?: React.CSSProperties; + tooltip?: string; + tooltipPosition?: string; + tooltipStyles?: React.CSSProperties; + touch?: boolean; + + onBlur?: React.FocusEventHandler; + onFocus?: React.FocusEventHandler; + } + export class IconButton extends React.Component { + } + + interface LeftNavProps extends React.Props { + disableSwipeToOpen?: boolean; + docked?: boolean; + header?: React.ReactElement; + menuItems: Menu.MenuItemRequest[]; + onChange?: Menu.ItemTapEventHandler; + onNavOpen?: () => void; + onNavClose?: () => void; + openRight?: Boolean; + selectedIndex?: number; + menuItemClassName?: string; + menuItemClassNameSubheader?: string; + menuItemClassNameLink?: string; + style?: React.CSSProperties; + } + export class LeftNav extends React.Component { + } + + interface LinearProgressProps extends React.Props { + mode?: string; + value?: number; + min?: number; + max?: number; + } + export class LinearProgress extends React.Component { + } + + namespace Lists { + interface ListProps extends React.Props { + insetSubheader?: boolean; + subheader?: string; + subheaderStyle?: React.CSSProperties; + zDepth?: number; + style?: React.CSSProperties; + } + export class List extends React.Component { + } + + interface ListDividerProps extends React.Props { + inset?: boolean; + } + export class ListDivider extends React.Component { + } + + interface ListItemProps extends React.Props { + autoGenerateNestedIndicator?: boolean; + disableKeyboardFocus?: boolean; + initiallyOpen?: boolean; + innerDivStyle?: React.CSSProperties; + insetChildren?: boolean; + innerStyle?: React.CSSProperties; + leftAvatar?: React.ReactElement; + leftCheckbox?: React.ReactElement; + leftIcon?: React.ReactElement; + nestedLevel?: number; + nestedItems?: React.ReactElement[]; + onKeyboardFocus?: React.FocusEventHandler; + onNestedListToggle?: (item: ListItem) => void; + onClick?: React.MouseEventHandler; + rightAvatar?: React.ReactElement; + rightIcon?: React.ReactElement; + rightIconButton?: React.ReactElement; + rightToggle?: React.ReactElement; + primaryText?: React.ReactNode; + secondaryText?: React.ReactNode; + secondaryTextLines?: number; + style?: React.CSSProperties; + } + export class ListItem extends React.Component { + } + } + + // Old menu implementation. Being replaced by new "menus". + namespace Menu { + interface ItemTapEventHandler { + (e: TouchTapEvent, index: number, menuItem: MenuItemRequest): void; + } + + // almost extends MenuItemProps, but certain required items are generated in Menu and not passed here. + interface MenuItemRequest extends React.Props { + // use value from MenuItem.Types.* + type?: string; + + text?: string; + data?: string; + payload?: string; + icon?: React.ReactElement; + attribute?: string; + number?: string; + toggle?: boolean; + onTouchTap?: TouchTapEventHandler; + isDisabled?: boolean; + style?: React.CSSProperties; + + // for MenuItems.Types.NESTED + items?: MenuItemRequest[]; + + // for custom text or payloads + [propertyName: string]: any; + } + + interface MenuProps extends React.Props { + index: number; + text?: string; + menuItems: MenuItemRequest[]; + zDepth?: number; + active?: boolean; + onItemTap?: ItemTapEventHandler; + menuItemStyle?: React.CSSProperties; + style?: React.CSSProperties; + } + export class Menu extends React.Component { + } + + interface MenuItemProps extends React.Props { + index: number; + icon?: React.ReactElement; + iconClassName?: string; + iconRightClassName?: string; + iconStyle?: React.CSSProperties; + iconRightStyle?: React.CSSProperties; + attribute?: string; + number?: string; + data?: string; + toggle?: boolean; + onTouchTap?: (e: React.MouseEvent, key: number) => void; + onToggle?: (e: React.MouseEvent, key: number, toggled: boolean) => void; + selected?: boolean; + active?: boolean; + style?: React.CSSProperties; + } + export class MenuItem extends React.Component { + static Types: { LINK: string, SUBHEADER: string, NESTED: string, } + } + } + + export namespace Mixins { + interface ClickAwayable extends React.Mixin { + } + var ClickAwayable: ClickAwayable; + + interface WindowListenable extends React.Mixin { + } + var WindowListenable: WindowListenable; + + interface StylePropable extends React.Mixin { + } + var StylePropable: StylePropable + + interface StyleResizable extends React.Mixin { + } + var StyleResizable: StyleResizable + } + + interface OverlayProps extends React.Props { + autoLockScrolling?: boolean; + show?: boolean; + transitionEnabled?: boolean; + } + export class Overlay extends React.Component { + } + + interface PaperProps extends React.HTMLAttributes, React.Props { + circle?: boolean; + rounded?: boolean; + transitionEnabled?: boolean; + zDepth?: number; + } + export class Paper extends React.Component { + } + + interface RadioButtonProps extends CommonEnhancedSwitchProps { + // is root element + defaultChecked?: boolean; + iconStyle?: React.CSSProperties; + label?: string; + labelStyle?: React.CSSProperties; + labelPosition?: string; + style?: React.CSSProperties; + value?: string; + + onCheck?: (e: React.FormEvent, selected: string) => void; + } + export class RadioButton extends React.Component { + } + + interface RadioButtonGroupProps extends React.Props { + defaultSelected?: string; + labelPosition?: string; + name: string; + style?: React.CSSProperties; + valueSelected?: string; + + onChange?: (e: React.FormEvent, selected: string) => void; + } + export class RadioButtonGroup extends React.Component { + getSelectedValue(): string; + setSelectedValue(newSelectionValue: string): void; + clearValue(): void; + } + + interface RaisedButtonProps extends SharedEnhancedButtonProps { + className?: string; + disabled?: boolean; + label?: string; + primary?: boolean; + secondary?: boolean; + labelStyle?: React.CSSProperties; + backgroundColor?: string; + labelColor?: string; + disabledBackgroundColor?: string; + disabledLabelColor?: string; + fullWidth?: boolean; + } + export class RaisedButton extends React.Component { + } + + interface RefreshIndicatorProps extends React.Props { + left: number; + percentage?: number; + size?: number; + status?: string; + top: number; + style?: React.CSSProperties; + } + export class RefreshIndicator extends React.Component { + } + + namespace Ripples { + interface CircleRippleProps extends React.Props { + color?: string; + opacity?: number; + style?: React.CSSProperties; + } + export class CircleRipple extends React.Component { + } + + interface FocusRippleProps extends React.Props { + color?: string; + style?: React.CSSProperties; + innerStyle?: React.CSSProperties; + opacity?: number; + show?: boolean; + } + export class FocusRipple extends React.Component { + } + + interface TouchRippleProps extends React.Props { + centerRipple?: boolean; + color?: string; + opacity?: number; + style?: React.CSSProperties; + } + export class TouchRipple extends React.Component { + } + } + + interface SelectFieldProps extends React.Props { + // passed to TextField + errorStyle?: React.CSSProperties; + errorText?: string; + floatingLabelText?: string; + floatingLabelStyle?: React.CSSProperties; + fullWidth?: boolean; + hintText?: string | React.ReactElement; + + // passed to DropDownMenu + displayMember?: string; + valueMember?: string; + autoWidth?: boolean; + menuItems: Menu.MenuItemRequest[]; + menuItemStyle?: React.CSSProperties; + selectedIndex?: number; + underlineStyle?: React.CSSProperties; + underlineFocusStyle?: React.CSSProperties; + iconStyle?: React.CSSProperties; + labelStyle?: React.CSSProperties; + style?: React.CSSProperties; + disabled?: boolean; + valueLink?: ReactLink; + value?: number; + + onChange?: Menu.ItemTapEventHandler; + onEnterKeyDown?: React.KeyboardEventHandler; + + // own properties + selectFieldRoot?: string; + multiLine?: boolean; + type?: string; + rows?: number; + inputStyle?: React.CSSProperties; + } + export class SelectField extends React.Component { + } + + interface SliderProps extends React.Props { + name: string; + defaultValue?: number; + description?: string; + error?: string; + max?: number; + min?: number; + required?: boolean; + step?: number; + value?: number; + style?: React.CSSProperties; + } + export class Slider extends React.Component { + } + + interface SvgIconProps extends React.Props { + color?: string; + hoverColor?: string; + viewBox?: string; + style?: React.CSSProperties; + } + export class SvgIcon extends React.Component { + } + + export namespace Icons { + export import NavigationMenu = __MaterialUI.NavigationMenu; + export import NavigationChevronLeft = __MaterialUI.NavigationChevronLeft; + export import NavigationChevronRight = __MaterialUI.NavigationChevronRight; + } + + interface NavigationMenuProps extends React.Props { + } + export class NavigationMenu extends React.Component { + } + + interface NavigationChevronLeftProps extends React.Props { + } + export class NavigationChevronLeft extends React.Component { + } + + interface NavigationChevronRightProps extends React.Props { + } + export class NavigationChevronRight extends React.Component { + } + + export namespace Styles { + interface AutoPrefix { + all(styles: React.CSSProperties): React.CSSProperties; + set(style: React.CSSProperties, key: string, value: string | number): void; + single(key: string): string; + singleHyphened(key: string): string; + } + export var AutoPrefix: AutoPrefix; + + interface Spacing { + iconSize?: number; + + desktopGutter?: number; + desktopGutterMore?: number; + desktopGutterLess?: number; + desktopGutterMini?: number; + desktopKeylineIncrement?: number; + desktopDropDownMenuItemHeight?: number; + desktopDropDownMenuFontSize?: number; + desktopLeftNavMenuItemHeight?: number; + desktopSubheaderHeight?: number; + desktopToolbarHeight?: number; + } + export var Spacing: Spacing; + + interface ThemePalette { + primary1Color?: string; + primary2Color?: string; + primary3Color?: string; + accent1Color?: string; + accent2Color?: string; + accent3Color?: string; + textColor?: string; + canvasColor?: string; + borderColor?: string; + disabledColor?: string; + alternateTextColor?: string; + } + interface MuiTheme { + rawTheme: RawTheme; + static: boolean; + appBar?: { + color?: string, + textColor?: string, + height?: number + }, + avatar?: { + borderColor?: string; + } + button?: { + height?: number, + minWidth?: number, + iconButtonSize?: number + }, + checkbox?: { + boxColor?: string, + checkedColor?: string, + requiredColor?: string, + disabledColor?: string, + labelColor?: string, + labelDisabledColor?: string + }, + datePicker?: { + color?: string, + textColor?: string, + calendarTextColor?: string, + selectColor?: string, + selectTextColor?: string, + }, + dropDownMenu?: { + accentColor?: string, + }, + flatButton?: { + color?: string, + textColor?: string, + primaryTextColor?: string, + secondaryTextColor?: string, + disabledColor?: string + }, + floatingActionButton?: { + buttonSize?: number, + miniSize?: number, + color?: string, + iconColor?: string, + secondaryColor?: string, + secondaryIconColor?: string, + disabledColor?: string, + disabledTextColor?: string + }, + inkBar?: { + backgroundColor?: string; + }, + leftNav?: { + width?: number, + color?: string, + }, + listItem?: { + nestedLevelDepth?: number; + }, + menu?: { + backgroundColor?: string, + containerBackgroundColor?: string, + }, + menuItem?: { + dataHeight?: number, + height?: number, + hoverColor?: string, + padding?: number, + selectedTextColor?: string, + }, + menuSubheader?: { + padding?: number, + borderColor?: string, + textColor?: string, + }, + paper?: { + backgroundColor?: string, + }, + radioButton?: { + borderColor?: string, + backgroundColor?: string, + checkedColor?: string, + requiredColor?: string, + disabledColor?: string, + size?: number, + labelColor?: string, + labelDisabledColor?: string + }, + raisedButton?: { + color?: string, + textColor?: string, + primaryColor?: string, + primaryTextColor?: string, + secondaryColor?: string, + secondaryTextColor?: string, + disabledColor?: string, + disabledTextColor?: string + }, + refreshIndicator?: { + strokeColor?: string; + loadingStrokeColor?: string; + }; + slider?: { + trackSize?: number, + trackColor?: string, + trackColorSelected?: string, + handleSize?: number, + handleSizeActive?: number, + handleSizeDisabled?: number, + handleColorZero?: string, + handleFillColor?: string, + selectionColor?: string, + rippleColor?: string, + }, + snackbar?: { + textColor?: string, + backgroundColor?: string, + actionColor?: string, + }, + table?: { + backgroundColor?: string; + }; + tableHeader?: { + borderColor?: string; + }; + tableHeaderColumn?: { + textColor?: string; + }; + tableFooter?: { + borderColor?: string; + textColor?: string; + }; + tableRow?: { + hoverColor?: string; + stripeColor?: string; + selectedColor?: string; + textColor?: string; + borderColor?: string; + }; + tableRowColumn?: { + height?: number; + spacing?: number; + }; + timePicker?: { + color?: string; + textColor?: string; + accentColor?: string; + clockColor?: string; + selectColor?: string; + selectTextColor?: string; + }; + toggle?: { + thumbOnColor?: string, + thumbOffColor?: string, + thumbDisabledColor?: string, + thumbRequiredColor?: string, + trackOnColor?: string, + trackOffColor?: string, + trackDisabledColor?: string, + trackRequiredColor?: string, + labelColor?: string, + labelDisabledColor?: string + }, + toolbar?: { + backgroundColor?: string, + height?: number, + titleFontSize?: number, + iconColor?: string, + separatorColor?: string, + menuHoverColor?: string, + }; + tabs?: { + backgroundColor?: string; + }; + textField?: { + textColor?: string; + hintColor?: string; + floatingLabelColor?: string; + disabledTextColor?: string; + errorColor?: string; + focusColor?: string; + backgroundColor?: string; + borderColor?: string; + }; + isRtl: boolean; + } + + interface RawTheme { + spacing: Spacing; + fontFamily?: string; + palette: ThemePalette; + } + + export function ThemeDecorator(muiTheme: Styles.MuiTheme):

(Component: React.ComponentClass

) => React.ComponentClass

; + + interface ThemeManager { + getMuiTheme(rawTheme: RawTheme): MuiTheme; + modifyRawThemeSpacing(muiTheme: MuiTheme, newSpacing: Spacing): MuiTheme; + modifyRawThemePalette(muiTheme: MuiTheme, newPaletteKeys: ThemePalette): MuiTheme; + modifyRawThemeFontFamily(muiTheme: MuiTheme, newFontFamily: string): MuiTheme; + } + export var ThemeManager: ThemeManager; + + interface Transitions { + easeOut(duration?: string, property?: string | string[], delay?: string, easeFunction?: string): string; + create(duration?: string, property?: string, delay?: string, easeFunction?: string): string; + easeOutFunction: string; + easeInOutFunction: string; + } + export var Transitions: Transitions; + + interface Typography { + textFullBlack: string; + textDarkBlack: string; + textLightBlack: string; + textMinBlack: string; + textFullWhite: string; + textDarkWhite: string; + textLightWhite: string; + + // font weight + fontWeightLight: number; + fontWeightNormal: number; + fontWeightMedium: number; + + fontStyleButtonFontSize: number; + } + export var Typography: Typography; + + export var DarkRawTheme: RawTheme; + export var LightRawTheme: RawTheme; + } + + interface SnackbarProps extends React.Props { + message: string; + action?: string; + autoHideDuration?: number; + onActionTouchTap?: React.TouchEventHandler; + onShow?: () => void; + onDismiss?: () => void; + openOnMount?: boolean; + style?: React.CSSProperties; + } + export class Snackbar extends React.Component { + } + + namespace Tabs { + interface TabProps extends React.Props { + label?: any; + value?: string; + selected?: boolean; + width?: string; + style?: React.CSSProperties; + + // Called by Tabs component + onActive?: (tab: Tab) => void; + + onTouchTap?: (value: string, e: TouchTapEvent, tab: Tab) => void; + } + export class Tab extends React.Component { + } + + interface TabsProps extends React.Props { + contentContainerStyle?: React.CSSProperties; + initialSelectedIndex?: number; + inkBarStyle?: React.CSSProperties; + style?: React.CSSProperties; + tabItemContainerStyle?: React.CSSProperties; + tabWidth?: number; + value?: string | number; + tabTemplate?: __React.ComponentClass; + + onChange?: (value: string | number, e: React.FormEvent, tab: Tab) => void; + } + export class Tabs extends React.Component { + } + } + + namespace Table { + interface TableProps extends React.Props { + allRowsSelected?: boolean; + fixedFooter?: boolean; + fixedHeader?: boolean; + height?: string; + multiSelectable?: boolean; + onCellClick?: (row: number, column: number) => void; + onCellHover?: (row: number, column: number) => void; + onCellHoverExit?: (row: number, column: number) => void; + onRowHover?: (row: number) => void; + onRowHoverExit?: (row: number) => void; + onRowSelection?: (selectedRows: number[]) => void; + selectable?: boolean; + style?: React.CSSProperties; + } + export class Table extends React.Component { + } + + interface TableBodyProps extends React.Props { + allRowsSelected?: boolean; + deselectOnClickaway?: boolean; + displayRowCheckbox?: boolean; + multiSelectable?: boolean; + onCellClick?: (row: number, column: number) => void; + onCellHover?: (row: number, column: number) => void; + onCellHoverExit?: (row: number, column: number) => void; + onRowHover?: (row: number) => void; + onRowHoverExit?: (row: number) => void; + onRowSelection?: (selectedRows: number[]) => void; + preScanRows?: boolean; + selectable?: boolean; + showRowHover?: boolean; + stripedRows?: boolean; + style?: React.CSSProperties; + } + export class TableBody extends React.Component { + } + + interface TableFooterProps extends React.Props { + adjustForCheckbox?: boolean; + style?: React.CSSProperties; + } + export class TableFooter extends React.Component { + } + + interface TableHeaderProps extends React.Props { + adjustForCheckbox?: boolean; + displaySelectAll?: boolean; + enableSelectAll?: boolean; + onSelectAll?: (event: React.MouseEvent) => void; + selectAllSelected?: boolean; + style?: React.CSSProperties; + } + export class TableHeader extends React.Component { + } + + interface TableHeaderColumnProps extends React.Props { + columnNumber?: number; + onClick?: (e: React.MouseEvent, column: number) => void; + tooltip?: string; + tooltipStyle?: React.CSSProperties; + style?: React.CSSProperties; + } + export class TableHeaderColumn extends React.Component { + } + + interface TableRowProps extends React.Props { + displayBorder?: boolean; + hoverable?: boolean; + onCellClick?: (e: React.MouseEvent, row: number, column: number) => void; + onCellHover?: (e: React.MouseEvent, row: number, column: number) => void; + onCellHoverExit?: (e: React.MouseEvent, row: number, column: number) => void; + onRowClick?: (e: React.MouseEvent, row: number) => void; + onRowHover?: (e: React.MouseEvent, row: number) => void; + onRowHoverExit?: (e: React.MouseEvent, row: number) => void; + rowNumber?: number; + selectable?: boolean; + selected?: boolean; + striped?: boolean; + style?: React.CSSProperties; + } + export class TableRow extends React.Component { + } + + interface TableRowColumnProps extends React.Props { + columnNumber?: number; + colSpan?: number; + hoverable?: boolean; + onClick?: React.MouseEventHandler; + onHover?: (e: React.MouseEvent, column: number) => void; + onHoverExit?: (e: React.MouseEvent, column: number) => void; + style?: React.CSSProperties; + } + export class TableRowColumn extends React.Component { + } + } + + interface ThemeWrapperProps extends React.Props { + theme: Styles.MuiTheme; + } + export class ThemeWrapper extends React.Component { + } + + interface ToggleProps extends CommonEnhancedSwitchProps { + // is root element + + elementStyle?: React.CSSProperties; + labelStyle?: React.CSSProperties; + onToggle?: (e: React.MouseEvent, isInputChecked: boolean) => void; + toggled?: boolean; + defaultToggled?: boolean; + } + export class Toggle extends React.Component { + isToggled(): boolean; + setToggled(newToggledValue: boolean): void; + } + + interface TimePickerProps extends React.Props { + defaultTime?: Date; + format?: string; + pedantic?: boolean; + style?: __React.CSSProperties; + textFieldStyle?: __React.CSSProperties; + autoOk?: boolean; + openDialog?: () => void; + onFocus?: React.FocusEventHandler; + onTouchTap?: TouchTapEventHandler; + onChange?: (e: any, time: Date) => void; + onShow?: () => void; + onDismiss?: () => void; + } + export class TimePicker extends React.Component { + } + + interface TextFieldProps extends React.Props { + errorStyle?: React.CSSProperties; + errorText?: string; + floatingLabelText?: string; + floatingLabelStyle?: React.CSSProperties; + fullWidth?: boolean; + hintText?: string | React.ReactElement; + id?: string; + inputStyle?: React.CSSProperties; + multiLine?: boolean; + onEnterKeyDown?: React.KeyboardEventHandler; + style?: React.CSSProperties; + rows?: number, + underlineStyle?: React.CSSProperties; + underlineFocusStyle?: React.CSSProperties; + underlineDisabledStyle?: React.CSSProperties; + type?: string; + hintStyle?: React.CSSProperties; + + disabled?: boolean; + isRtl?: boolean; + value?: string; + defaultValue?: string; + valueLink?: ReactLink; + + onBlur?: React.FocusEventHandler; + onChange?: React.FormEventHandler; + onFocus?: React.FocusEventHandler; + onKeyDown?: React.KeyboardEventHandler; + } + export class TextField extends React.Component { + blur(): void; + clearValue(): void; + focus(): void; + getValue(): string; + setErrorText(newErrorText: string): void; + setValue(newValue: string): void; + } + + namespace Toolbar { + interface ToolbarProps extends React.Props { + style?: React.CSSProperties; + } + export class Toolbar extends React.Component { + } + + interface ToolbarGroupProps extends React.Props { + float?: string; + style?: React.CSSProperties; + } + export class ToolbarGroup extends React.Component { + } + + interface ToolbarSeparatorProps extends React.Props { + style?: React.CSSProperties; + } + export class ToolbarSeparator extends React.Component { + } + + interface ToolbarTitleProps extends React.HTMLAttributes, React.Props { + text?: string; + style?: React.CSSProperties; + } + export class ToolbarTitle extends React.Component { + } + } + + interface TooltipProps extends React.Props { + label: string; + show?: boolean; + touch?: boolean; + verticalPosition?: string; + horizontalPosition?: string; + } + export class Tooltip extends React.Component { + } + + export namespace Utils { + interface ContrastLevel { + range: [number, number]; + color: string; + } + interface ColorManipulator { + fade(color: string, amount: string | number): string; + lighten(color: string, amount: string | number): string; + darken(color: string, amount: string | number): string; + contrastRatio(background: string, foreground: string): number; + contrastRatioLevel(background: string, foreground: string): ContrastLevel; + } + export var ColorManipulator: ColorManipulator; + + interface CssEvent { + transitionEndEventName(): string; + animationEndEventName(): string; + onTransitionEnd(el: Element, callback: () => void): void; + onAnimationEnd(el: Element, callback: () => void): void; + } + export var CssEvent: CssEvent; + + interface Dom { + isDescendant(parent: Node, child: Node): boolean; + offset(el: Element): { top: number, left: number }; + getStyleAttributeAsNumber(el: HTMLElement, attr: string): number; + addClass(el: Element, className: string): void; + removeClass(el: Element, className: string): void; + hasClass(el: Element, className: string): boolean; + toggleClass(el: Element, className: string): void; + forceRedraw(el: HTMLElement): void; + withoutTransition(el: HTMLElement, callback: () => void): void; + } + export var Dom: Dom; + + interface Events { + once(el: Element, type: string, callback: EventListener): void; + on(el: Element, type: string, callback: EventListener): void; + off(el: Element, type: string, callback: EventListener): void; + isKeyboard(e: Event): boolean; + } + export var Events: Events; + + function Extend(base: T, override: S1): (T & S1); + + interface ImmutabilityHelper { + merge(base: any, ...args: any[]): any; + mergeItem(obj: any, key: any, newValueObject: any): any; + push(array: any[], obj: any): any[]; + shift(array: any[]): any[]; + } + export var ImmutabilityHelper: ImmutabilityHelper; + + interface KeyCode { + DOWN: number; + ESC: number; + ENTER: number; + LEFT: number; + RIGHT: number; + SPACE: number; + TAB: number; + UP: number; + } + var KeyCode: KeyCode; + + interface KeyLine { + Desktop: { + GUTTER: number; + GUTTER_LESS: number; + INCREMENT: number; + MENU_ITEM_HEIGHT: number; + }; + + getIncrementalDim(dim: number): number; + } + export var KeyLine: KeyLine; + + interface UniqueId { + generate(): string; + } + export var UniqueId: UniqueId; + + interface Styles { + mergeAndPrefix(base: any, ...args: any[]): React.CSSProperties; + } + export var Styles: Styles; + } + + // New menus available only through requiring directly to the end file + namespace Menus { + interface IconMenuProps extends React.Props { + closeOnItemTouchTap?: boolean; + desktop?: boolean; + iconButtonElement: React.ReactElement; + openDirection?: string; + menuStyle?: React.CSSProperties; + multiple?: boolean; + value?: string | Array; + width?: string | number; + touchTapCloseDelay?: number; + style?: React.CSSProperties; + + onKeyboardFocus?: React.FocusEventHandler; + onItemTouchTap?: (e: TouchTapEvent, item: React.ReactElement) => void; + onChange?: (e: React.FormEvent, value: string | Array) => void; + } + export class IconMenu extends React.Component { + } + + interface MenuProps extends React.Props { + animated?: boolean; + autoWidth?: boolean; + desktop?: boolean; + listStyle?: React.CSSProperties; + maxHeight?: number; + multiple?: boolean; + openDirection?: string; + value?: string | Array; + width?: string | number; + zDepth?: number; + style?: React.CSSProperties; + } + export class Menu extends React.Component{ + } + + interface MenuItemProps extends React.Props { + checked?: boolean; + desktop?: boolean; + disabled?: boolean; + innerDivStyle?: React.CSSProperties; + insetChildren?: boolean; + leftIcon?: React.ReactElement; + primaryText?: string | React.ReactElement; + rightIcon?: React.ReactElement; + secondaryText?: React.ReactNode; + value?: string; + style?: React.CSSProperties; + + onEscKeyDown?: React.KeyboardEventHandler; + onItemTouchTap?: (e: TouchTapEvent, item: React.ReactElement) => void; + onChange?: (e: React.FormEvent, value: string) => void; + } + export class MenuItem extends React.Component{ + } + + interface MenuDividerProps extends React.Props { + inset?: boolean; + style?: React.CSSProperties; + } + export class MenuDivider extends React.Component{ + } + } + + namespace GridList { + + interface GridListProps extends React.Props { + cols?: number; + padding?: number; + cellHeight?: number; + style?: React.CSSProperties; + } + + export class GridList extends React.Component{ + } + + interface GridTileProps extends React.Props { + title?: string; + subtitle?: __React.ReactNode; + titlePosition?: string; //"top"|"bottom" + titleBackground?: string; + actionIcon?: __React.ReactElement; + actionPosition?: string; //"left"|"right" + cols?: number; + rows?: number; + rootClass?: string | __React.Component; + style?: React.CSSProperties; + } + + export class GridTile extends React.Component{ + } + + } +} // __MaterialUI + +declare module 'material-ui/lib/app-bar' { + import AppBar = __MaterialUI.AppBar; + export = AppBar; +} + +declare module 'material-ui/lib/app-canvas' { + import AppCanvas = __MaterialUI.AppCanvas; + export = AppCanvas; +} + +declare module 'material-ui/lib/avatar' { + import Avatar = __MaterialUI.Avatar; + export = Avatar; +} + +declare module "material-ui/lib/badge" { + import Badge = __MaterialUI.Badge; + export = Badge; +} + +declare module 'material-ui/lib/before-after-wrapper' { + import BeforeAfterWrapper = __MaterialUI.BeforeAfterWrapper; + export = BeforeAfterWrapper; +} + +declare module 'material-ui/lib/card/card' { + import Card = __MaterialUI.Card.Card; + export = Card; +} + +declare module 'material-ui/lib/card/card-actions' { + import CardActions = __MaterialUI.Card.CardActions; + export = CardActions; +} + +declare module 'material-ui/lib/card/card-expandable' { + import CardExpandable = __MaterialUI.Card.CardExpandable; + export = CardExpandable; +} + +declare module 'material-ui/lib/card/card-header' { + import CardHeader = __MaterialUI.Card.CardHeader; + export = CardHeader; +} + +declare module 'material-ui/lib/card/card-media' { + import CardMedia = __MaterialUI.Card.CardMedia; + export = CardMedia; +} + +declare module 'material-ui/lib/card/card-text' { + import CardText = __MaterialUI.Card.CardText; + export = CardText; +} + +declare module 'material-ui/lib/card/card-title' { + import CardTitle = __MaterialUI.Card.CardTitle; + export = CardTitle; +} + +declare module 'material-ui/lib/checkbox' { + import Checkbox = __MaterialUI.Checkbox; + export = Checkbox; +} + +declare module 'material-ui/lib/circular-progress' { + import CircularProgress = __MaterialUI.CircularProgress; + export = CircularProgress; +} + +declare module 'material-ui/lib/clearfix' { + import ClearFix = __MaterialUI.ClearFix; + export = ClearFix; +} + +declare module 'material-ui/lib/date-picker/date-picker' { + import DatePicker = __MaterialUI.DatePicker.DatePicker; + export = DatePicker; +} + +declare module 'material-ui/lib/date-picker/date-picker-dialog' { + import DatePickerDialog = __MaterialUI.DatePicker.DatePickerDialog; + export = DatePickerDialog; +} + +declare module 'material-ui/lib/dialog' { + import Dialog = __MaterialUI.Dialog; + export = Dialog; +} + +declare module 'material-ui/lib/drop-down-icon' { + import DropDownIcon = __MaterialUI.DropDownIcon; + export = DropDownIcon; +} + +declare module 'material-ui/lib/drop-down-menu' { + import DropDownMenu = __MaterialUI.DropDownMenu; + export = DropDownMenu; +} + +declare module 'material-ui/lib/enhanced-button' { + import EnhancedButton = __MaterialUI.EnhancedButton; + export = EnhancedButton; +} + +declare module 'material-ui/lib/flat-button' { + import FlatButton = __MaterialUI.FlatButton; + export = FlatButton; +} + +declare module 'material-ui/lib/floating-action-button' { + import FloatingActionButton = __MaterialUI.FloatingActionButton; + export = FloatingActionButton; +} + +declare module 'material-ui/lib/font-icon' { + import FontIcon = __MaterialUI.FontIcon; + export = FontIcon; +} + +declare module 'material-ui/lib/icon-button' { + import IconButton = __MaterialUI.IconButton; + export = IconButton; +} + +declare module 'material-ui/lib/left-nav' { + import LeftNav = __MaterialUI.LeftNav; + export = LeftNav; +} + +declare module 'material-ui/lib/linear-progress' { + import LinearProgress = __MaterialUI.LinearProgress; + export = LinearProgress; +} + +declare module 'material-ui/lib/lists/list' { + import List = __MaterialUI.Lists.List; + export = List; +} + +declare module 'material-ui/lib/lists/list-divider' { + import ListDivider = __MaterialUI.Lists.ListDivider; + export = ListDivider; +} + +declare module 'material-ui/lib/lists/list-item' { + import ListItem = __MaterialUI.Lists.ListItem; + export = ListItem; +} + +declare module 'material-ui/lib/menu/menu' { + import Menu = __MaterialUI.Menu.Menu; + export = Menu; +} + +declare module 'material-ui/lib/menu/menu-item' { + import MenuItem = __MaterialUI.Menu.MenuItem; + export = MenuItem; +} + +declare module 'material-ui/lib/mixins/' { + export import ClickAwayable = __MaterialUI.Mixins.ClickAwayable; // require('material-ui/lib/mixins/click-awayable'); + export import WindowListenable = __MaterialUI.Mixins.WindowListenable; // require('material-ui/lib/mixins/window-listenable'); + export import StylePropable = __MaterialUI.Mixins.StylePropable; // require('material-ui/lib/mixins/style-propable'); + export import StyleResizable = __MaterialUI.Mixins.StyleResizable; // require('material-ui/lib/mixins/style-resizable'); +} + +declare module 'material-ui/lib/mixins/click-awayable' { + import ClickAwayable = __MaterialUI.Mixins.ClickAwayable; + export = ClickAwayable; +} + +declare module 'material-ui/lib/mixins/window-listenable' { + import WindowListenable = __MaterialUI.Mixins.WindowListenable; + export = WindowListenable; +} + +declare module 'material-ui/lib/mixins/style-propable' { + import StylePropable = __MaterialUI.Mixins.StylePropable; + export = StylePropable; +} + +declare module 'material-ui/lib/mixins/style-resizable' { + import StyleResizable = __MaterialUI.Mixins.StyleResizable; + export = StyleResizable; +} + +declare module 'material-ui/lib/overlay' { + import Overlay = __MaterialUI.Overlay; + export = Overlay; +} + +declare module 'material-ui/lib/paper' { + import Paper = __MaterialUI.Paper; + export = Paper; +} + +declare module 'material-ui/lib/radio-button' { + import RadioButton = __MaterialUI.RadioButton; + export = RadioButton; +} + +declare module 'material-ui/lib/radio-button-group' { + import RadioButtonGroup = __MaterialUI.RadioButtonGroup; + export = RadioButtonGroup; +} + +declare module 'material-ui/lib/raised-button' { + import RaisedButton = __MaterialUI.RaisedButton; + export = RaisedButton; +} + +declare module 'material-ui/lib/refresh-indicator' { + import RefreshIndicator = __MaterialUI.RefreshIndicator; + export = RefreshIndicator; +} + +declare module 'material-ui/lib/ripples/' { + export import CircleRipple = __MaterialUI.Ripples.CircleRipple; + export import FocusRipple = __MaterialUI.Ripples.FocusRipple; + export import TouchRipple = __MaterialUI.Ripples.TouchRipple; +} + +declare module 'material-ui/lib/select-field' { + import SelectField = __MaterialUI.SelectField; + export = SelectField; +} + +declare module 'material-ui/lib/slider' { + import Slider = __MaterialUI.Slider; + export = Slider; +} + +declare module 'material-ui/lib/svg-icon' { + import SvgIcon = __MaterialUI.SvgIcon; + export = SvgIcon; +} + +declare module 'material-ui/lib/svg-icons/navigation/menu' { + import NavigationMenu = __MaterialUI.NavigationMenu; + export = NavigationMenu; +} + +declare module 'material-ui/lib/svg-icons/navigation/chevron-left' { + import NavigationChevronLeft = __MaterialUI.NavigationChevronLeft; + export = NavigationChevronLeft; +} + +declare module 'material-ui/lib/svg-icons/navigation/chevron-right' { + import NavigationChevronRight = __MaterialUI.NavigationChevronRight; + export = NavigationChevronRight; +} + +declare module 'material-ui/lib/styles/' { + export import AutoPrefix = __MaterialUI.Styles.AutoPrefix; // require('material-ui/lib/styles/auto-prefix'); + export import Colors = __MaterialUI.Styles.Colors; // require('material-ui/lib/styles/colors'); + export import Spacing = require('material-ui/lib/styles/spacing'); + export import ThemeManager = __MaterialUI.Styles.ThemeManager; // require('material-ui/lib/styles/theme-manager'); + export import Transitions = __MaterialUI.Styles.Transitions; // require('material-ui/lib/styles/transitions'); + export import Typography = __MaterialUI.Styles.Typography; // require('material-ui/lib/styles/typography'); + export import LightRawTheme = __MaterialUI.Styles.LightRawTheme; // require('material-ui/lib/styles/raw-themes/light-raw-theme'), + export import DarkRawTheme = __MaterialUI.Styles.DarkRawTheme; // require('material-ui/lib/styles/raw-themes/dark-raw-theme'), + export import ThemeDecorator = __MaterialUI.Styles.ThemeDecorator; //require('material-ui/lib/styles/theme-decorator'); +} + +declare module 'material-ui/lib/styles/auto-prefix' { + import AutoPrefix = __MaterialUI.Styles.AutoPrefix; + export = AutoPrefix; +} + +declare module 'material-ui/lib/styles/spacing' { + type Spacing = __MaterialUI.Styles.Spacing; + var Spacing: Spacing; + export = Spacing; +} + +declare module 'material-ui/lib/styles/theme-manager' { + import ThemeManager = __MaterialUI.Styles.ThemeManager; + export = ThemeManager; +} + +declare module 'material-ui/lib/styles/transitions' { + import Transitions = __MaterialUI.Styles.Transitions; + export = Transitions; +} + +declare module 'material-ui/lib/styles/typography' { + import Typography = __MaterialUI.Styles.Typography; + export = Typography; +} + +declare module 'material-ui/lib/styles/raw-themes/light-raw-theme' { + import LightRawTheme = __MaterialUI.Styles.LightRawTheme; + export = LightRawTheme; +} + +declare module 'material-ui/lib/styles/raw-themes/dark-raw-theme' { + import DarkRawTheme = __MaterialUI.Styles.DarkRawTheme; + export = DarkRawTheme; +} + +declare module 'material-ui/lib/styles/theme-decorator' { + import ThemeDecorator = __MaterialUI.Styles.ThemeDecorator; + export = ThemeDecorator; +} + + +declare module 'material-ui/lib/snackbar' { + import Snackbar = __MaterialUI.Snackbar; + export = Snackbar; +} + +declare module 'material-ui/lib/tabs/tab' { + import Tab = __MaterialUI.Tabs.Tab; + export = Tab; +} + +declare module 'material-ui/lib/tabs/tabs' { + import Tabs = __MaterialUI.Tabs.Tabs; + export = Tabs; +} + +declare module 'material-ui/lib/table/table' { + import Table = __MaterialUI.Table.Table; + export = Table; +} + +declare module 'material-ui/lib/table/table-body' { + import TableBody = __MaterialUI.Table.TableBody; + export = TableBody; +} + +declare module 'material-ui/lib/table/table-footer' { + import TableFooter = __MaterialUI.Table.TableFooter; + export = TableFooter; +} + +declare module 'material-ui/lib/table/table-header' { + import TableHeader = __MaterialUI.Table.TableHeader; + export = TableHeader; +} + +declare module 'material-ui/lib/table/table-header-column' { + import TableHeaderColumn = __MaterialUI.Table.TableHeaderColumn; + export = TableHeaderColumn; +} + +declare module 'material-ui/lib/table/table-row' { + import TableRow = __MaterialUI.Table.TableRow; + export = TableRow; +} + +declare module 'material-ui/lib/table/table-row-column' { + import TableRowColumn = __MaterialUI.Table.TableRowColumn; + export = TableRowColumn; +} + +declare module 'material-ui/lib/theme-wrapper' { + import ThemeWrapper = __MaterialUI.ThemeWrapper; + export = ThemeWrapper; +} + +declare module 'material-ui/lib/toggle' { + import Toggle = __MaterialUI.Toggle; + export = Toggle; +} + +declare module 'material-ui/lib/time-picker' { + import TimePicker = __MaterialUI.TimePicker; + export = TimePicker; +} + +declare module 'material-ui/lib/text-field' { + import TextField = __MaterialUI.TextField; + export = TextField; +} + +declare module 'material-ui/lib/toolbar/toolbar' { + import Toolbar = __MaterialUI.Toolbar.Toolbar; + export = Toolbar; +} + +declare module 'material-ui/lib/toolbar/toolbar-group' { + import ToolbarGroup = __MaterialUI.Toolbar.ToolbarGroup; + export = ToolbarGroup; +} + +declare module 'material-ui/lib/toolbar/toolbar-separator' { + import ToolbarSeparator = __MaterialUI.Toolbar.ToolbarSeparator; + export = ToolbarSeparator; +} + +declare module 'material-ui/lib/toolbar/toolbar-title' { + import ToolbarTitle = __MaterialUI.Toolbar.ToolbarTitle; + export = ToolbarTitle; +} + +declare module 'material-ui/lib/tooltip' { + import Tooltip = __MaterialUI.Tooltip; + export = Tooltip; +} + +declare module 'material-ui/lib/utils/' { + export import ColorManipulator = __MaterialUI.Utils.ColorManipulator; // require('material-ui/lib/utils/color-manipulator'); + export import CssEvent = __MaterialUI.Utils.CssEvent; // require('material-ui/lib/utils/css-event'); + export import Dom = __MaterialUI.Utils.Dom; // require('material-ui/lib/utils/dom'); + export import Events = __MaterialUI.Utils.Events; // require('material-ui/lib/utils/events'); + export import Extend = __MaterialUI.Utils.Extend; // require('material-ui/lib/utils/extend'); + export import ImmutabilityHelper = __MaterialUI.Utils.ImmutabilityHelper; // require('material-ui/lib/utils/immutability-helper'); + export import KeyCode = __MaterialUI.Utils.KeyCode; // require('material-ui/lib/utils/key-code'); + export import KeyLine = __MaterialUI.Utils.KeyLine; // require('material-ui/lib/utils/key-line'); + export import UniqueId = __MaterialUI.Utils.UniqueId; // require('material-ui/lib/utils/unique-id'); + export import Styles = __MaterialUI.Utils.Styles; // require('material-ui/lib/utils/styles'); +} + +declare module 'material-ui/lib/utils/color-manipulator' { + import ColorManipulator = __MaterialUI.Utils.ColorManipulator; + export = ColorManipulator; +} + +declare module 'material-ui/lib/utils/css-event' { + import CssEvent = __MaterialUI.Utils.CssEvent; + export = CssEvent; +} + +declare module 'material-ui/lib/utils/dom' { + import Dom = __MaterialUI.Utils.Dom; + export = Dom; +} + +declare module 'material-ui/lib/utils/events' { + import Events = __MaterialUI.Utils.Events; + export = Events; +} + +declare module 'material-ui/lib/utils/extend' { + import Extend = __MaterialUI.Utils.Extend; + export = Extend; +} + +declare module 'material-ui/lib/utils/immutability-helper' { + import ImmutabilityHelper = __MaterialUI.Utils.ImmutabilityHelper; + export = ImmutabilityHelper; +} + +declare module 'material-ui/lib/utils/key-code' { + import KeyCode = __MaterialUI.Utils.KeyCode; + export = KeyCode; +} + +declare module 'material-ui/lib/utils/key-line' { + import KeyLine = __MaterialUI.Utils.KeyLine; + export = KeyLine; +} + +declare module 'material-ui/lib/utils/unique-id' { + import UniqueId = __MaterialUI.Utils.UniqueId; + export = UniqueId; +} + +declare module 'material-ui/lib/utils/styles' { + import Styles = __MaterialUI.Utils.Styles; + export = Styles; +} + +declare module "material-ui/lib/menus/icon-menu" { + import IconMenu = __MaterialUI.Menus.IconMenu; + export = IconMenu; +} + +declare module "material-ui/lib/menus/menu" { + import Menu = __MaterialUI.Menus.Menu; + export = Menu; +} + +declare module "material-ui/lib/menus/menu-item" { + import MenuItem = __MaterialUI.Menus.MenuItem; + export = MenuItem; +} + +declare module "material-ui/lib/menus/menu-divider" { + import MenuDivider = __MaterialUI.Menus.MenuDivider; + export = MenuDivider; +} + +declare module "material-ui/lib/grid-list/grid-list" { + import GridList = __MaterialUI.GridList.GridList; + export = GridList; +} + +declare module "material-ui/lib/grid-list/grid-tile" { + import GridTile = __MaterialUI.GridList.GridTile; + export = GridTile; +} + +declare module "material-ui/lib/styles/colors" { + import Colors = __MaterialUI.Styles.Colors; + export = Colors; +} + +declare namespace __MaterialUI.Styles { + interface Colors { + red50: string; + red100: string; + red200: string; + red300: string; + red400: string; + red500: string; + red600: string; + red700: string; + red800: string; + red900: string; + redA100: string; + redA200: string; + redA400: string; + redA700: string; + + pink50: string; + pink100: string; + pink200: string; + pink300: string; + pink400: string; + pink500: string; + pink600: string; + pink700: string; + pink800: string; + pink900: string; + pinkA100: string; + pinkA200: string; + pinkA400: string; + pinkA700: string; + + purple50: string; + purple100: string; + purple200: string; + purple300: string; + purple400: string; + purple500: string; + purple600: string; + purple700: string; + purple800: string; + purple900: string; + purpleA100: string; + purpleA200: string; + purpleA400: string; + purpleA700: string; + + deepPurple50: string; + deepPurple100: string; + deepPurple200: string; + deepPurple300: string; + deepPurple400: string; + deepPurple500: string; + deepPurple600: string; + deepPurple700: string; + deepPurple800: string; + deepPurple900: string; + deepPurpleA100: string; + deepPurpleA200: string; + deepPurpleA400: string; + deepPurpleA700: string; + + indigo50: string; + indigo100: string; + indigo200: string; + indigo300: string; + indigo400: string; + indigo500: string; + indigo600: string; + indigo700: string; + indigo800: string; + indigo900: string; + indigoA100: string; + indigoA200: string; + indigoA400: string; + indigoA700: string; + + blue50: string; + blue100: string; + blue200: string; + blue300: string; + blue400: string; + blue500: string; + blue600: string; + blue700: string; + blue800: string; + blue900: string; + blueA100: string; + blueA200: string; + blueA400: string; + blueA700: string; + + lightBlue50: string; + lightBlue100: string; + lightBlue200: string; + lightBlue300: string; + lightBlue400: string; + lightBlue500: string; + lightBlue600: string; + lightBlue700: string; + lightBlue800: string; + lightBlue900: string; + lightBlueA100: string; + lightBlueA200: string; + lightBlueA400: string; + lightBlueA700: string; + + cyan50: string; + cyan100: string; + cyan200: string; + cyan300: string; + cyan400: string; + cyan500: string; + cyan600: string; + cyan700: string; + cyan800: string; + cyan900: string; + cyanA100: string; + cyanA200: string; + cyanA400: string; + cyanA700: string; + + teal50: string; + teal100: string; + teal200: string; + teal300: string; + teal400: string; + teal500: string; + teal600: string; + teal700: string; + teal800: string; + teal900: string; + tealA100: string; + tealA200: string; + tealA400: string; + tealA700: string; + + green50: string; + green100: string; + green200: string; + green300: string; + green400: string; + green500: string; + green600: string; + green700: string; + green800: string; + green900: string; + greenA100: string; + greenA200: string; + greenA400: string; + greenA700: string; + + lightGreen50: string; + lightGreen100: string; + lightGreen200: string; + lightGreen300: string; + lightGreen400: string; + lightGreen500: string; + lightGreen600: string; + lightGreen700: string; + lightGreen800: string; + lightGreen900: string; + lightGreenA100: string; + lightGreenA200: string; + lightGreenA400: string; + lightGreenA700: string; + + lime50: string; + lime100: string; + lime200: string; + lime300: string; + lime400: string; + lime500: string; + lime600: string; + lime700: string; + lime800: string; + lime900: string; + limeA100: string; + limeA200: string; + limeA400: string; + limeA700: string; + + yellow50: string; + yellow100: string; + yellow200: string; + yellow300: string; + yellow400: string; + yellow500: string; + yellow600: string; + yellow700: string; + yellow800: string; + yellow900: string; + yellowA100: string; + yellowA200: string; + yellowA400: string; + yellowA700: string; + + amber50: string; + amber100: string; + amber200: string; + amber300: string; + amber400: string; + amber500: string; + amber600: string; + amber700: string; + amber800: string; + amber900: string; + amberA100: string; + amberA200: string; + amberA400: string; + amberA700: string; + + orange50: string; + orange100: string; + orange200: string; + orange300: string; + orange400: string; + orange500: string; + orange600: string; + orange700: string; + orange800: string; + orange900: string; + orangeA100: string; + orangeA200: string; + orangeA400: string; + orangeA700: string; + + deepOrange50: string; + deepOrange100: string; + deepOrange200: string; + deepOrange300: string; + deepOrange400: string; + deepOrange500: string; + deepOrange600: string; + deepOrange700: string; + deepOrange800: string; + deepOrange900: string; + deepOrangeA100: string; + deepOrangeA200: string; + deepOrangeA400: string; + deepOrangeA700: string; + + brown50: string; + brown100: string; + brown200: string; + brown300: string; + brown400: string; + brown500: string; + brown600: string; + brown700: string; + brown800: string; + brown900: string; + + blueGrey50: string; + blueGrey100: string; + blueGrey200: string; + blueGrey300: string; + blueGrey400: string; + blueGrey500: string; + blueGrey600: string; + blueGrey700: string; + blueGrey800: string; + blueGrey900: string; + + grey50: string; + grey100: string; + grey200: string; + grey300: string; + grey400: string; + grey500: string; + grey600: string; + grey700: string; + grey800: string; + grey900: string; + + black: string; + white: string; + + transparent: string; + fullBlack: string; + darkBlack: string; + lightBlack: string; + minBlack: string; + faintBlack: string; + fullWhite: string; + darkWhite: string; + lightWhite: string; + } + export var Colors: Colors; +} + +declare module "material-ui/lib/svg-icons" { + export var ActionAccessibility: __MaterialUI.SvgIcon; + export var ActionAccessible: __MaterialUI.SvgIcon; + export var ActionAccountBalanceWallet: __MaterialUI.SvgIcon; + export var ActionAccountBalance: __MaterialUI.SvgIcon; + export var ActionAccountBox: __MaterialUI.SvgIcon; + export var ActionAccountCircle: __MaterialUI.SvgIcon; + export var ActionAddShoppingCart: __MaterialUI.SvgIcon; + export var ActionAlarmAdd: __MaterialUI.SvgIcon; + export var ActionAlarmOff: __MaterialUI.SvgIcon; + export var ActionAlarmOn: __MaterialUI.SvgIcon; + export var ActionAlarm: __MaterialUI.SvgIcon; + export var ActionAllOut: __MaterialUI.SvgIcon; + export var ActionAndroid: __MaterialUI.SvgIcon; + export var ActionAnnouncement: __MaterialUI.SvgIcon; + export var ActionAspectRatio: __MaterialUI.SvgIcon; + export var ActionAssessment: __MaterialUI.SvgIcon; + export var ActionAssignmentInd: __MaterialUI.SvgIcon; + export var ActionAssignmentLate: __MaterialUI.SvgIcon; + export var ActionAssignmentReturn: __MaterialUI.SvgIcon; + export var ActionAssignmentReturned: __MaterialUI.SvgIcon; + export var ActionAssignmentTurnedIn: __MaterialUI.SvgIcon; + export var ActionAssignment: __MaterialUI.SvgIcon; + export var ActionAutorenew: __MaterialUI.SvgIcon; + export var ActionBackup: __MaterialUI.SvgIcon; + export var ActionBook: __MaterialUI.SvgIcon; + export var ActionBookmarkBorder: __MaterialUI.SvgIcon; + export var ActionBookmark: __MaterialUI.SvgIcon; + export var ActionBugReport: __MaterialUI.SvgIcon; + export var ActionBuild: __MaterialUI.SvgIcon; + export var ActionCached: __MaterialUI.SvgIcon; + export var ActionCameraEnhance: __MaterialUI.SvgIcon; + export var ActionCardGiftcard: __MaterialUI.SvgIcon; + export var ActionCardMembership: __MaterialUI.SvgIcon; + export var ActionCardTravel: __MaterialUI.SvgIcon; + export var ActionChangeHistory: __MaterialUI.SvgIcon; + export var ActionCheckCircle: __MaterialUI.SvgIcon; + export var ActionChromeReaderMode: __MaterialUI.SvgIcon; + export var ActionClass: __MaterialUI.SvgIcon; + export var ActionCode: __MaterialUI.SvgIcon; + export var ActionCompareArrows: __MaterialUI.SvgIcon; + export var ActionCopyright: __MaterialUI.SvgIcon; + export var ActionCreditCard: __MaterialUI.SvgIcon; + export var ActionDashboard: __MaterialUI.SvgIcon; + export var ActionDateRange: __MaterialUI.SvgIcon; + export var ActionDelete: __MaterialUI.SvgIcon; + export var ActionDescription: __MaterialUI.SvgIcon; + export var ActionDns: __MaterialUI.SvgIcon; + export var ActionDoneAll: __MaterialUI.SvgIcon; + export var ActionDone: __MaterialUI.SvgIcon; + export var ActionDonutLarge: __MaterialUI.SvgIcon; + export var ActionDonutSmall: __MaterialUI.SvgIcon; + export var ActionEject: __MaterialUI.SvgIcon; + export var ActionEventSeat: __MaterialUI.SvgIcon; + export var ActionEvent: __MaterialUI.SvgIcon; + export var ActionExitToApp: __MaterialUI.SvgIcon; + export var ActionExplore: __MaterialUI.SvgIcon; + export var ActionExtension: __MaterialUI.SvgIcon; + export var ActionFace: __MaterialUI.SvgIcon; + export var ActionFavoriteBorder: __MaterialUI.SvgIcon; + export var ActionFavorite: __MaterialUI.SvgIcon; + export var ActionFeedback: __MaterialUI.SvgIcon; + export var ActionFindInPage: __MaterialUI.SvgIcon; + export var ActionFindReplace: __MaterialUI.SvgIcon; + export var ActionFingerprint: __MaterialUI.SvgIcon; + export var ActionFlightLand: __MaterialUI.SvgIcon; + export var ActionFlightTakeoff: __MaterialUI.SvgIcon; + export var ActionFlipToBack: __MaterialUI.SvgIcon; + export var ActionFlipToFront: __MaterialUI.SvgIcon; + export var ActionGavel: __MaterialUI.SvgIcon; + export var ActionGetApp: __MaterialUI.SvgIcon; + export var ActionGif: __MaterialUI.SvgIcon; + export var ActionGrade: __MaterialUI.SvgIcon; + export var ActionGroupWork: __MaterialUI.SvgIcon; + export var ActionHelpOutline: __MaterialUI.SvgIcon; + export var ActionHelp: __MaterialUI.SvgIcon; + export var ActionHighlightOff: __MaterialUI.SvgIcon; + export var ActionHistory: __MaterialUI.SvgIcon; + export var ActionHome: __MaterialUI.SvgIcon; + export var ActionHourglassEmpty: __MaterialUI.SvgIcon; + export var ActionHourglassFull: __MaterialUI.SvgIcon; + export var ActionHttp: __MaterialUI.SvgIcon; + export var ActionHttps: __MaterialUI.SvgIcon; + export var ActionImportantDevices: __MaterialUI.SvgIcon; + export var ActionInfoOutline: __MaterialUI.SvgIcon; + export var ActionInfo: __MaterialUI.SvgIcon; + export var ActionInput: __MaterialUI.SvgIcon; + export var ActionInvertColors: __MaterialUI.SvgIcon; + export var ActionLabelOutline: __MaterialUI.SvgIcon; + export var ActionLabel: __MaterialUI.SvgIcon; + export var ActionLanguage: __MaterialUI.SvgIcon; + export var ActionLaunch: __MaterialUI.SvgIcon; + export var ActionLightbulbOutline: __MaterialUI.SvgIcon; + export var ActionLineStyle: __MaterialUI.SvgIcon; + export var ActionLineWeight: __MaterialUI.SvgIcon; + export var ActionList: __MaterialUI.SvgIcon; + export var ActionLockOpen: __MaterialUI.SvgIcon; + export var ActionLockOutline: __MaterialUI.SvgIcon; + export var ActionLock: __MaterialUI.SvgIcon; + export var ActionLoyalty: __MaterialUI.SvgIcon; + export var ActionMarkunreadMailbox: __MaterialUI.SvgIcon; + export var ActionMotorcycle: __MaterialUI.SvgIcon; + export var ActionNoteAdd: __MaterialUI.SvgIcon; + export var ActionOfflinePin: __MaterialUI.SvgIcon; + export var ActionOpacity: __MaterialUI.SvgIcon; + export var ActionOpenInBrowser: __MaterialUI.SvgIcon; + export var ActionOpenInNew: __MaterialUI.SvgIcon; + export var ActionOpenWith: __MaterialUI.SvgIcon; + export var ActionPageview: __MaterialUI.SvgIcon; + export var ActionPanTool: __MaterialUI.SvgIcon; + export var ActionPayment: __MaterialUI.SvgIcon; + export var ActionPermCameraMic: __MaterialUI.SvgIcon; + export var ActionPermContactCalendar: __MaterialUI.SvgIcon; + export var ActionPermDataSetting: __MaterialUI.SvgIcon; + export var ActionPermDeviceInformation: __MaterialUI.SvgIcon; + export var ActionPermIdentity: __MaterialUI.SvgIcon; + export var ActionPermMedia: __MaterialUI.SvgIcon; + export var ActionPermPhoneMsg: __MaterialUI.SvgIcon; + export var ActionPermScanWifi: __MaterialUI.SvgIcon; + export var ActionPets: __MaterialUI.SvgIcon; + export var ActionPictureInPictureAlt: __MaterialUI.SvgIcon; + export var ActionPictureInPicture: __MaterialUI.SvgIcon; + export var ActionPlayForWork: __MaterialUI.SvgIcon; + export var ActionPolymer: __MaterialUI.SvgIcon; + export var ActionPowerSettingsNew: __MaterialUI.SvgIcon; + export var ActionPregnantWoman: __MaterialUI.SvgIcon; + export var ActionPrint: __MaterialUI.SvgIcon; + export var ActionQueryBuilder: __MaterialUI.SvgIcon; + export var ActionQuestionAnswer: __MaterialUI.SvgIcon; + export var ActionReceipt: __MaterialUI.SvgIcon; + export var ActionRecordVoiceOver: __MaterialUI.SvgIcon; + export var ActionRedeem: __MaterialUI.SvgIcon; + export var ActionReorder: __MaterialUI.SvgIcon; + export var ActionReportProblem: __MaterialUI.SvgIcon; + export var ActionRestore: __MaterialUI.SvgIcon; + export var ActionRoom: __MaterialUI.SvgIcon; + export var ActionRoundedCorner: __MaterialUI.SvgIcon; + export var ActionRowing: __MaterialUI.SvgIcon; + export var ActionSchedule: __MaterialUI.SvgIcon; + export var ActionSearch: __MaterialUI.SvgIcon; + export var ActionSettingsApplications: __MaterialUI.SvgIcon; + export var ActionSettingsBackupRestore: __MaterialUI.SvgIcon; + export var ActionSettingsBluetooth: __MaterialUI.SvgIcon; + export var ActionSettingsBrightness: __MaterialUI.SvgIcon; + export var ActionSettingsCell: __MaterialUI.SvgIcon; + export var ActionSettingsEthernet: __MaterialUI.SvgIcon; + export var ActionSettingsInputAntenna: __MaterialUI.SvgIcon; + export var ActionSettingsInputComponent: __MaterialUI.SvgIcon; + export var ActionSettingsInputComposite: __MaterialUI.SvgIcon; + export var ActionSettingsInputHdmi: __MaterialUI.SvgIcon; + export var ActionSettingsInputSvideo: __MaterialUI.SvgIcon; + export var ActionSettingsOverscan: __MaterialUI.SvgIcon; + export var ActionSettingsPhone: __MaterialUI.SvgIcon; + export var ActionSettingsPower: __MaterialUI.SvgIcon; + export var ActionSettingsRemote: __MaterialUI.SvgIcon; + export var ActionSettingsVoice: __MaterialUI.SvgIcon; + export var ActionSettings: __MaterialUI.SvgIcon; + export var ActionShopTwo: __MaterialUI.SvgIcon; + export var ActionShop: __MaterialUI.SvgIcon; + export var ActionShoppingBasket: __MaterialUI.SvgIcon; + export var ActionShoppingCart: __MaterialUI.SvgIcon; + export var ActionSpeakerNotes: __MaterialUI.SvgIcon; + export var ActionSpellcheck: __MaterialUI.SvgIcon; + export var ActionStars: __MaterialUI.SvgIcon; + export var ActionStore: __MaterialUI.SvgIcon; + export var ActionSubject: __MaterialUI.SvgIcon; + export var ActionSupervisorAccount: __MaterialUI.SvgIcon; + export var ActionSwapHoriz: __MaterialUI.SvgIcon; + export var ActionSwapVert: __MaterialUI.SvgIcon; + export var ActionSwapVerticalCircle: __MaterialUI.SvgIcon; + export var ActionSystemUpdateAlt: __MaterialUI.SvgIcon; + export var ActionTabUnselected: __MaterialUI.SvgIcon; + export var ActionTab: __MaterialUI.SvgIcon; + export var ActionTheaters: __MaterialUI.SvgIcon; + export var ActionThreeDRotation: __MaterialUI.SvgIcon; + export var ActionThumbDown: __MaterialUI.SvgIcon; + export var ActionThumbUp: __MaterialUI.SvgIcon; + export var ActionThumbsUpDown: __MaterialUI.SvgIcon; + export var ActionTimeline: __MaterialUI.SvgIcon; + export var ActionToc: __MaterialUI.SvgIcon; + export var ActionToday: __MaterialUI.SvgIcon; + export var ActionToll: __MaterialUI.SvgIcon; + export var ActionTouchApp: __MaterialUI.SvgIcon; + export var ActionTrackChanges: __MaterialUI.SvgIcon; + export var ActionTranslate: __MaterialUI.SvgIcon; + export var ActionTrendingDown: __MaterialUI.SvgIcon; + export var ActionTrendingFlat: __MaterialUI.SvgIcon; + export var ActionTrendingUp: __MaterialUI.SvgIcon; + export var ActionTurnedInNot: __MaterialUI.SvgIcon; + export var ActionTurnedIn: __MaterialUI.SvgIcon; + export var ActionUpdate: __MaterialUI.SvgIcon; + export var ActionVerifiedUser: __MaterialUI.SvgIcon; + export var ActionViewAgenda: __MaterialUI.SvgIcon; + export var ActionViewArray: __MaterialUI.SvgIcon; + export var ActionViewCarousel: __MaterialUI.SvgIcon; + export var ActionViewColumn: __MaterialUI.SvgIcon; + export var ActionViewDay: __MaterialUI.SvgIcon; + export var ActionViewHeadline: __MaterialUI.SvgIcon; + export var ActionViewList: __MaterialUI.SvgIcon; + export var ActionViewModule: __MaterialUI.SvgIcon; + export var ActionViewQuilt: __MaterialUI.SvgIcon; + export var ActionViewStream: __MaterialUI.SvgIcon; + export var ActionViewWeek: __MaterialUI.SvgIcon; + export var ActionVisibilityOff: __MaterialUI.SvgIcon; + export var ActionVisibility: __MaterialUI.SvgIcon; + export var ActionWatchLater: __MaterialUI.SvgIcon; + export var ActionWork: __MaterialUI.SvgIcon; + export var ActionYoutubeSearchedFor: __MaterialUI.SvgIcon; + export var ActionZoomIn: __MaterialUI.SvgIcon; + export var ActionZoomOut: __MaterialUI.SvgIcon; + export var AlertAddAlert: __MaterialUI.SvgIcon; + export var AlertErrorOutline: __MaterialUI.SvgIcon; + export var AlertError: __MaterialUI.SvgIcon; + export var AlertWarning: __MaterialUI.SvgIcon; + export var AvAddToQueue: __MaterialUI.SvgIcon; + export var AvAirplay: __MaterialUI.SvgIcon; + export var AvAlbum: __MaterialUI.SvgIcon; + export var AvArtTrack: __MaterialUI.SvgIcon; + export var AvAvTimer: __MaterialUI.SvgIcon; + export var AvClosedCaption: __MaterialUI.SvgIcon; + export var AvEqualizer: __MaterialUI.SvgIcon; + export var AvExplicit: __MaterialUI.SvgIcon; + export var AvFastForward: __MaterialUI.SvgIcon; + export var AvFastRewind: __MaterialUI.SvgIcon; + export var AvFiberDvr: __MaterialUI.SvgIcon; + export var AvFiberManualRecord: __MaterialUI.SvgIcon; + export var AvFiberNew: __MaterialUI.SvgIcon; + export var AvFiberPin: __MaterialUI.SvgIcon; + export var AvFiberSmartRecord: __MaterialUI.SvgIcon; + export var AvForward10: __MaterialUI.SvgIcon; + export var AvForward30: __MaterialUI.SvgIcon; + export var AvForward5: __MaterialUI.SvgIcon; + export var AvGames: __MaterialUI.SvgIcon; + export var AvHd: __MaterialUI.SvgIcon; + export var AvHearing: __MaterialUI.SvgIcon; + export var AvHighQuality: __MaterialUI.SvgIcon; + export var AvLibraryAdd: __MaterialUI.SvgIcon; + export var AvLibraryBooks: __MaterialUI.SvgIcon; + export var AvLibraryMusic: __MaterialUI.SvgIcon; + export var AvLoop: __MaterialUI.SvgIcon; + export var AvMicNone: __MaterialUI.SvgIcon; + export var AvMicOff: __MaterialUI.SvgIcon; + export var AvMic: __MaterialUI.SvgIcon; + export var AvMovie: __MaterialUI.SvgIcon; + export var AvMusicVideo: __MaterialUI.SvgIcon; + export var AvNewReleases: __MaterialUI.SvgIcon; + export var AvNotInterested: __MaterialUI.SvgIcon; + export var AvPauseCircleFilled: __MaterialUI.SvgIcon; + export var AvPauseCircleOutline: __MaterialUI.SvgIcon; + export var AvPause: __MaterialUI.SvgIcon; + export var AvPlayArrow: __MaterialUI.SvgIcon; + export var AvPlayCircleFilled: __MaterialUI.SvgIcon; + export var AvPlayCircleOutline: __MaterialUI.SvgIcon; + export var AvPlaylistAddCheck: __MaterialUI.SvgIcon; + export var AvPlaylistAdd: __MaterialUI.SvgIcon; + export var AvPlaylistPlay: __MaterialUI.SvgIcon; + export var AvQueueMusic: __MaterialUI.SvgIcon; + export var AvQueuePlayNext: __MaterialUI.SvgIcon; + export var AvQueue: __MaterialUI.SvgIcon; + export var AvRadio: __MaterialUI.SvgIcon; + export var AvRecentActors: __MaterialUI.SvgIcon; + export var AvRemoveFromQueue: __MaterialUI.SvgIcon; + export var AvRepeatOne: __MaterialUI.SvgIcon; + export var AvRepeat: __MaterialUI.SvgIcon; + export var AvReplay10: __MaterialUI.SvgIcon; + export var AvReplay30: __MaterialUI.SvgIcon; + export var AvReplay5: __MaterialUI.SvgIcon; + export var AvReplay: __MaterialUI.SvgIcon; + export var AvShuffle: __MaterialUI.SvgIcon; + export var AvSkipNext: __MaterialUI.SvgIcon; + export var AvSkipPrevious: __MaterialUI.SvgIcon; + export var AvSlowMotionVideo: __MaterialUI.SvgIcon; + export var AvSnooze: __MaterialUI.SvgIcon; + export var AvSortByAlpha: __MaterialUI.SvgIcon; + export var AvStop: __MaterialUI.SvgIcon; + export var AvSubscriptions: __MaterialUI.SvgIcon; + export var AvSubtitles: __MaterialUI.SvgIcon; + export var AvSurroundSound: __MaterialUI.SvgIcon; + export var AvVideoLibrary: __MaterialUI.SvgIcon; + export var AvVideocamOff: __MaterialUI.SvgIcon; + export var AvVideocam: __MaterialUI.SvgIcon; + export var AvVolumeDown: __MaterialUI.SvgIcon; + export var AvVolumeMute: __MaterialUI.SvgIcon; + export var AvVolumeOff: __MaterialUI.SvgIcon; + export var AvVolumeUp: __MaterialUI.SvgIcon; + export var AvWebAsset: __MaterialUI.SvgIcon; + export var AvWeb: __MaterialUI.SvgIcon; + export var CommunicationBusiness: __MaterialUI.SvgIcon; + export var CommunicationCallEnd: __MaterialUI.SvgIcon; + export var CommunicationCallMade: __MaterialUI.SvgIcon; + export var CommunicationCallMerge: __MaterialUI.SvgIcon; + export var CommunicationCallMissedOutgoing: __MaterialUI.SvgIcon; + export var CommunicationCallMissed: __MaterialUI.SvgIcon; + export var CommunicationCallReceived: __MaterialUI.SvgIcon; + export var CommunicationCallSplit: __MaterialUI.SvgIcon; + export var CommunicationCall: __MaterialUI.SvgIcon; + export var CommunicationChatBubbleOutline: __MaterialUI.SvgIcon; + export var CommunicationChatBubble: __MaterialUI.SvgIcon; + export var CommunicationChat: __MaterialUI.SvgIcon; + export var CommunicationClearAll: __MaterialUI.SvgIcon; + export var CommunicationComment: __MaterialUI.SvgIcon; + export var CommunicationContactMail: __MaterialUI.SvgIcon; + export var CommunicationContactPhone: __MaterialUI.SvgIcon; + export var CommunicationContacts: __MaterialUI.SvgIcon; + export var CommunicationDialerSip: __MaterialUI.SvgIcon; + export var CommunicationDialpad: __MaterialUI.SvgIcon; + export var CommunicationEmail: __MaterialUI.SvgIcon; + export var CommunicationForum: __MaterialUI.SvgIcon; + export var CommunicationImportContacts: __MaterialUI.SvgIcon; + export var CommunicationImportExport: __MaterialUI.SvgIcon; + export var CommunicationInvertColorsOff: __MaterialUI.SvgIcon; + export var CommunicationLiveHelp: __MaterialUI.SvgIcon; + export var CommunicationLocationOff: __MaterialUI.SvgIcon; + export var CommunicationLocationOn: __MaterialUI.SvgIcon; + export var CommunicationMailOutline: __MaterialUI.SvgIcon; + export var CommunicationMessage: __MaterialUI.SvgIcon; + export var CommunicationNoSim: __MaterialUI.SvgIcon; + export var CommunicationPhone: __MaterialUI.SvgIcon; + export var CommunicationPhonelinkErase: __MaterialUI.SvgIcon; + export var CommunicationPhonelinkLock: __MaterialUI.SvgIcon; + export var CommunicationPhonelinkRing: __MaterialUI.SvgIcon; + export var CommunicationPhonelinkSetup: __MaterialUI.SvgIcon; + export var CommunicationPortableWifiOff: __MaterialUI.SvgIcon; + export var CommunicationPresentToAll: __MaterialUI.SvgIcon; + export var CommunicationRingVolume: __MaterialUI.SvgIcon; + export var CommunicationScreenShare: __MaterialUI.SvgIcon; + export var CommunicationSpeakerPhone: __MaterialUI.SvgIcon; + export var CommunicationStayCurrentLandscape: __MaterialUI.SvgIcon; + export var CommunicationStayCurrentPortrait: __MaterialUI.SvgIcon; + export var CommunicationStayPrimaryLandscape: __MaterialUI.SvgIcon; + export var CommunicationStayPrimaryPortrait: __MaterialUI.SvgIcon; + export var CommunicationStopScreenShare: __MaterialUI.SvgIcon; + export var CommunicationSwapCalls: __MaterialUI.SvgIcon; + export var CommunicationTextsms: __MaterialUI.SvgIcon; + export var CommunicationVoicemail: __MaterialUI.SvgIcon; + export var CommunicationVpnKey: __MaterialUI.SvgIcon; + export var ContentAddBox: __MaterialUI.SvgIcon; + export var ContentAddCircleOutline: __MaterialUI.SvgIcon; + export var ContentAddCircle: __MaterialUI.SvgIcon; + export var ContentAdd: __MaterialUI.SvgIcon; + export var ContentArchive: __MaterialUI.SvgIcon; + export var ContentBackspace: __MaterialUI.SvgIcon; + export var ContentBlock: __MaterialUI.SvgIcon; + export var ContentClear: __MaterialUI.SvgIcon; + export var ContentContentCopy: __MaterialUI.SvgIcon; + export var ContentContentCut: __MaterialUI.SvgIcon; + export var ContentContentPaste: __MaterialUI.SvgIcon; + export var ContentCreate: __MaterialUI.SvgIcon; + export var ContentDrafts: __MaterialUI.SvgIcon; + export var ContentFilterList: __MaterialUI.SvgIcon; + export var ContentFlag: __MaterialUI.SvgIcon; + export var ContentFontDownload: __MaterialUI.SvgIcon; + export var ContentForward: __MaterialUI.SvgIcon; + export var ContentGesture: __MaterialUI.SvgIcon; + export var ContentInbox: __MaterialUI.SvgIcon; + export var ContentLink: __MaterialUI.SvgIcon; + export var ContentMail: __MaterialUI.SvgIcon; + export var ContentMarkunread: __MaterialUI.SvgIcon; + export var ContentMoveToInbox: __MaterialUI.SvgIcon; + export var ContentNextWeek: __MaterialUI.SvgIcon; + export var ContentRedo: __MaterialUI.SvgIcon; + export var ContentRemoveCircleOutline: __MaterialUI.SvgIcon; + export var ContentRemoveCircle: __MaterialUI.SvgIcon; + export var ContentRemove: __MaterialUI.SvgIcon; + export var ContentReplyAll: __MaterialUI.SvgIcon; + export var ContentReply: __MaterialUI.SvgIcon; + export var ContentReport: __MaterialUI.SvgIcon; + export var ContentSave: __MaterialUI.SvgIcon; + export var ContentSelectAll: __MaterialUI.SvgIcon; + export var ContentSend: __MaterialUI.SvgIcon; + export var ContentSort: __MaterialUI.SvgIcon; + export var ContentTextFormat: __MaterialUI.SvgIcon; + export var ContentUnarchive: __MaterialUI.SvgIcon; + export var ContentUndo: __MaterialUI.SvgIcon; + export var ContentWeekend: __MaterialUI.SvgIcon; + export var DeviceAccessAlarm: __MaterialUI.SvgIcon; + export var DeviceAccessAlarms: __MaterialUI.SvgIcon; + export var DeviceAccessTime: __MaterialUI.SvgIcon; + export var DeviceAddAlarm: __MaterialUI.SvgIcon; + export var DeviceAirplanemodeActive: __MaterialUI.SvgIcon; + export var DeviceAirplanemodeInactive: __MaterialUI.SvgIcon; + export var DeviceBattery20: __MaterialUI.SvgIcon; + export var DeviceBattery30: __MaterialUI.SvgIcon; + export var DeviceBattery50: __MaterialUI.SvgIcon; + export var DeviceBattery60: __MaterialUI.SvgIcon; + export var DeviceBattery80: __MaterialUI.SvgIcon; + export var DeviceBattery90: __MaterialUI.SvgIcon; + export var DeviceBatteryAlert: __MaterialUI.SvgIcon; + export var DeviceBatteryCharging20: __MaterialUI.SvgIcon; + export var DeviceBatteryCharging30: __MaterialUI.SvgIcon; + export var DeviceBatteryCharging50: __MaterialUI.SvgIcon; + export var DeviceBatteryCharging60: __MaterialUI.SvgIcon; + export var DeviceBatteryCharging80: __MaterialUI.SvgIcon; + export var DeviceBatteryCharging90: __MaterialUI.SvgIcon; + export var DeviceBatteryChargingFull: __MaterialUI.SvgIcon; + export var DeviceBatteryFull: __MaterialUI.SvgIcon; + export var DeviceBatteryStd: __MaterialUI.SvgIcon; + export var DeviceBatteryUnknown: __MaterialUI.SvgIcon; + export var DeviceBluetoothConnected: __MaterialUI.SvgIcon; + export var DeviceBluetoothDisabled: __MaterialUI.SvgIcon; + export var DeviceBluetoothSearching: __MaterialUI.SvgIcon; + export var DeviceBluetooth: __MaterialUI.SvgIcon; + export var DeviceBrightnessAuto: __MaterialUI.SvgIcon; + export var DeviceBrightnessHigh: __MaterialUI.SvgIcon; + export var DeviceBrightnessLow: __MaterialUI.SvgIcon; + export var DeviceBrightnessMedium: __MaterialUI.SvgIcon; + export var DeviceDataUsage: __MaterialUI.SvgIcon; + export var DeviceDeveloperMode: __MaterialUI.SvgIcon; + export var DeviceDevices: __MaterialUI.SvgIcon; + export var DeviceDvr: __MaterialUI.SvgIcon; + export var DeviceGpsFixed: __MaterialUI.SvgIcon; + export var DeviceGpsNotFixed: __MaterialUI.SvgIcon; + export var DeviceGpsOff: __MaterialUI.SvgIcon; + export var DeviceGraphicEq: __MaterialUI.SvgIcon; + export var DeviceLocationDisabled: __MaterialUI.SvgIcon; + export var DeviceLocationSearching: __MaterialUI.SvgIcon; + export var DeviceNetworkCell: __MaterialUI.SvgIcon; + export var DeviceNetworkWifi: __MaterialUI.SvgIcon; + export var DeviceNfc: __MaterialUI.SvgIcon; + export var DeviceScreenLockLandscape: __MaterialUI.SvgIcon; + export var DeviceScreenLockPortrait: __MaterialUI.SvgIcon; + export var DeviceScreenLockRotation: __MaterialUI.SvgIcon; + export var DeviceScreenRotation: __MaterialUI.SvgIcon; + export var DeviceSdStorage: __MaterialUI.SvgIcon; + export var DeviceSettingsSystemDaydream: __MaterialUI.SvgIcon; + export var DeviceSignalCellular0Bar: __MaterialUI.SvgIcon; + export var DeviceSignalCellular1Bar: __MaterialUI.SvgIcon; + export var DeviceSignalCellular2Bar: __MaterialUI.SvgIcon; + export var DeviceSignalCellular3Bar: __MaterialUI.SvgIcon; + export var DeviceSignalCellular4Bar: __MaterialUI.SvgIcon; + export var DeviceSignalCellularConnectedNoInternet0Bar: __MaterialUI.SvgIcon; + export var DeviceSignalCellularConnectedNoInternet1Bar: __MaterialUI.SvgIcon; + export var DeviceSignalCellularConnectedNoInternet2Bar: __MaterialUI.SvgIcon; + export var DeviceSignalCellularConnectedNoInternet3Bar: __MaterialUI.SvgIcon; + export var DeviceSignalCellularConnectedNoInternet4Bar: __MaterialUI.SvgIcon; + export var DeviceSignalCellularNoSim: __MaterialUI.SvgIcon; + export var DeviceSignalCellularNull: __MaterialUI.SvgIcon; + export var DeviceSignalCellularOff: __MaterialUI.SvgIcon; + export var DeviceSignalWifi0Bar: __MaterialUI.SvgIcon; + export var DeviceSignalWifi1BarLock: __MaterialUI.SvgIcon; + export var DeviceSignalWifi1Bar: __MaterialUI.SvgIcon; + export var DeviceSignalWifi2BarLock: __MaterialUI.SvgIcon; + export var DeviceSignalWifi2Bar: __MaterialUI.SvgIcon; + export var DeviceSignalWifi3BarLock: __MaterialUI.SvgIcon; + export var DeviceSignalWifi3Bar: __MaterialUI.SvgIcon; + export var DeviceSignalWifi4BarLock: __MaterialUI.SvgIcon; + export var DeviceSignalWifi4Bar: __MaterialUI.SvgIcon; + export var DeviceSignalWifiOff: __MaterialUI.SvgIcon; + export var DeviceStorage: __MaterialUI.SvgIcon; + export var DeviceUsb: __MaterialUI.SvgIcon; + export var DeviceWallpaper: __MaterialUI.SvgIcon; + export var DeviceWidgets: __MaterialUI.SvgIcon; + export var DeviceWifiLock: __MaterialUI.SvgIcon; + export var DeviceWifiTethering: __MaterialUI.SvgIcon; + export var EditorAttachFile: __MaterialUI.SvgIcon; + export var EditorAttachMoney: __MaterialUI.SvgIcon; + export var EditorBorderAll: __MaterialUI.SvgIcon; + export var EditorBorderBottom: __MaterialUI.SvgIcon; + export var EditorBorderClear: __MaterialUI.SvgIcon; + export var EditorBorderColor: __MaterialUI.SvgIcon; + export var EditorBorderHorizontal: __MaterialUI.SvgIcon; + export var EditorBorderInner: __MaterialUI.SvgIcon; + export var EditorBorderLeft: __MaterialUI.SvgIcon; + export var EditorBorderOuter: __MaterialUI.SvgIcon; + export var EditorBorderRight: __MaterialUI.SvgIcon; + export var EditorBorderStyle: __MaterialUI.SvgIcon; + export var EditorBorderTop: __MaterialUI.SvgIcon; + export var EditorBorderVertical: __MaterialUI.SvgIcon; + export var EditorDragHandle: __MaterialUI.SvgIcon; + export var EditorFormatAlignCenter: __MaterialUI.SvgIcon; + export var EditorFormatAlignJustify: __MaterialUI.SvgIcon; + export var EditorFormatAlignLeft: __MaterialUI.SvgIcon; + export var EditorFormatAlignRight: __MaterialUI.SvgIcon; + export var EditorFormatBold: __MaterialUI.SvgIcon; + export var EditorFormatClear: __MaterialUI.SvgIcon; + export var EditorFormatColorFill: __MaterialUI.SvgIcon; + export var EditorFormatColorReset: __MaterialUI.SvgIcon; + export var EditorFormatColorText: __MaterialUI.SvgIcon; + export var EditorFormatIndentDecrease: __MaterialUI.SvgIcon; + export var EditorFormatIndentIncrease: __MaterialUI.SvgIcon; + export var EditorFormatItalic: __MaterialUI.SvgIcon; + export var EditorFormatLineSpacing: __MaterialUI.SvgIcon; + export var EditorFormatListBulleted: __MaterialUI.SvgIcon; + export var EditorFormatListNumbered: __MaterialUI.SvgIcon; + export var EditorFormatPaint: __MaterialUI.SvgIcon; + export var EditorFormatQuote: __MaterialUI.SvgIcon; + export var EditorFormatShapes: __MaterialUI.SvgIcon; + export var EditorFormatSize: __MaterialUI.SvgIcon; + export var EditorFormatStrikethrough: __MaterialUI.SvgIcon; + export var EditorFormatTextdirectionLToR: __MaterialUI.SvgIcon; + export var EditorFormatTextdirectionRToL: __MaterialUI.SvgIcon; + export var EditorFormatUnderlined: __MaterialUI.SvgIcon; + export var EditorFunctions: __MaterialUI.SvgIcon; + export var EditorHighlight: __MaterialUI.SvgIcon; + export var EditorInsertChart: __MaterialUI.SvgIcon; + export var EditorInsertComment: __MaterialUI.SvgIcon; + export var EditorInsertDriveFile: __MaterialUI.SvgIcon; + export var EditorInsertEmoticon: __MaterialUI.SvgIcon; + export var EditorInsertInvitation: __MaterialUI.SvgIcon; + export var EditorInsertLink: __MaterialUI.SvgIcon; + export var EditorInsertPhoto: __MaterialUI.SvgIcon; + export var EditorLinearScale: __MaterialUI.SvgIcon; + export var EditorMergeType: __MaterialUI.SvgIcon; + export var EditorModeComment: __MaterialUI.SvgIcon; + export var EditorModeEdit: __MaterialUI.SvgIcon; + export var EditorMoneyOff: __MaterialUI.SvgIcon; + export var EditorPublish: __MaterialUI.SvgIcon; + export var EditorShortText: __MaterialUI.SvgIcon; + export var EditorSpaceBar: __MaterialUI.SvgIcon; + export var EditorStrikethroughS: __MaterialUI.SvgIcon; + export var EditorTextFields: __MaterialUI.SvgIcon; + export var EditorVerticalAlignBottom: __MaterialUI.SvgIcon; + export var EditorVerticalAlignCenter: __MaterialUI.SvgIcon; + export var EditorVerticalAlignTop: __MaterialUI.SvgIcon; + export var EditorWrapText: __MaterialUI.SvgIcon; + export var FileAttachment: __MaterialUI.SvgIcon; + export var FileCloudCircle: __MaterialUI.SvgIcon; + export var FileCloudDone: __MaterialUI.SvgIcon; + export var FileCloudDownload: __MaterialUI.SvgIcon; + export var FileCloudOff: __MaterialUI.SvgIcon; + export var FileCloudQueue: __MaterialUI.SvgIcon; + export var FileCloudUpload: __MaterialUI.SvgIcon; + export var FileCloud: __MaterialUI.SvgIcon; + export var FileCreateNewFolder: __MaterialUI.SvgIcon; + export var FileFileDownload: __MaterialUI.SvgIcon; + export var FileFileUpload: __MaterialUI.SvgIcon; + export var FileFolderOpen: __MaterialUI.SvgIcon; + export var FileFolderShared: __MaterialUI.SvgIcon; + export var FileFolder: __MaterialUI.SvgIcon; + export var HardwareCastConnected: __MaterialUI.SvgIcon; + export var HardwareCast: __MaterialUI.SvgIcon; + export var HardwareComputer: __MaterialUI.SvgIcon; + export var HardwareDesktopMac: __MaterialUI.SvgIcon; + export var HardwareDesktopWindows: __MaterialUI.SvgIcon; + export var HardwareDeveloperBoard: __MaterialUI.SvgIcon; + export var HardwareDeviceHub: __MaterialUI.SvgIcon; + export var HardwareDevicesOther: __MaterialUI.SvgIcon; + export var HardwareDock: __MaterialUI.SvgIcon; + export var HardwareGamepad: __MaterialUI.SvgIcon; + export var HardwareHeadsetMic: __MaterialUI.SvgIcon; + export var HardwareHeadset: __MaterialUI.SvgIcon; + export var HardwareKeyboardArrowDown: __MaterialUI.SvgIcon; + export var HardwareKeyboardArrowLeft: __MaterialUI.SvgIcon; + export var HardwareKeyboardArrowRight: __MaterialUI.SvgIcon; + export var HardwareKeyboardArrowUp: __MaterialUI.SvgIcon; + export var HardwareKeyboardBackspace: __MaterialUI.SvgIcon; + export var HardwareKeyboardCapslock: __MaterialUI.SvgIcon; + export var HardwareKeyboardHide: __MaterialUI.SvgIcon; + export var HardwareKeyboardReturn: __MaterialUI.SvgIcon; + export var HardwareKeyboardTab: __MaterialUI.SvgIcon; + export var HardwareKeyboardVoice: __MaterialUI.SvgIcon; + export var HardwareKeyboard: __MaterialUI.SvgIcon; + export var HardwareLaptopChromebook: __MaterialUI.SvgIcon; + export var HardwareLaptopMac: __MaterialUI.SvgIcon; + export var HardwareLaptopWindows: __MaterialUI.SvgIcon; + export var HardwareLaptop: __MaterialUI.SvgIcon; + export var HardwareMemory: __MaterialUI.SvgIcon; + export var HardwareMouse: __MaterialUI.SvgIcon; + export var HardwarePhoneAndroid: __MaterialUI.SvgIcon; + export var HardwarePhoneIphone: __MaterialUI.SvgIcon; + export var HardwarePhonelinkOff: __MaterialUI.SvgIcon; + export var HardwarePhonelink: __MaterialUI.SvgIcon; + export var HardwarePowerInput: __MaterialUI.SvgIcon; + export var HardwareRouter: __MaterialUI.SvgIcon; + export var HardwareScanner: __MaterialUI.SvgIcon; + export var HardwareSecurity: __MaterialUI.SvgIcon; + export var HardwareSimCard: __MaterialUI.SvgIcon; + export var HardwareSmartphone: __MaterialUI.SvgIcon; + export var HardwareSpeakerGroup: __MaterialUI.SvgIcon; + export var HardwareSpeaker: __MaterialUI.SvgIcon; + export var HardwareTabletAndroid: __MaterialUI.SvgIcon; + export var HardwareTabletMac: __MaterialUI.SvgIcon; + export var HardwareTablet: __MaterialUI.SvgIcon; + export var HardwareToys: __MaterialUI.SvgIcon; + export var HardwareTv: __MaterialUI.SvgIcon; + export var HardwareVideogameAsset: __MaterialUI.SvgIcon; + export var HardwareWatch: __MaterialUI.SvgIcon; + export var ImageAddAPhoto: __MaterialUI.SvgIcon; + export var ImageAddToPhotos: __MaterialUI.SvgIcon; + export var ImageAdjust: __MaterialUI.SvgIcon; + export var ImageAssistantPhoto: __MaterialUI.SvgIcon; + export var ImageAssistant: __MaterialUI.SvgIcon; + export var ImageAudiotrack: __MaterialUI.SvgIcon; + export var ImageBlurCircular: __MaterialUI.SvgIcon; + export var ImageBlurLinear: __MaterialUI.SvgIcon; + export var ImageBlurOff: __MaterialUI.SvgIcon; + export var ImageBlurOn: __MaterialUI.SvgIcon; + export var ImageBrightness1: __MaterialUI.SvgIcon; + export var ImageBrightness2: __MaterialUI.SvgIcon; + export var ImageBrightness3: __MaterialUI.SvgIcon; + export var ImageBrightness4: __MaterialUI.SvgIcon; + export var ImageBrightness5: __MaterialUI.SvgIcon; + export var ImageBrightness6: __MaterialUI.SvgIcon; + export var ImageBrightness7: __MaterialUI.SvgIcon; + export var ImageBrokenImage: __MaterialUI.SvgIcon; + export var ImageBrush: __MaterialUI.SvgIcon; + export var ImageCameraAlt: __MaterialUI.SvgIcon; + export var ImageCameraFront: __MaterialUI.SvgIcon; + export var ImageCameraRear: __MaterialUI.SvgIcon; + export var ImageCameraRoll: __MaterialUI.SvgIcon; + export var ImageCamera: __MaterialUI.SvgIcon; + export var ImageCenterFocusStrong: __MaterialUI.SvgIcon; + export var ImageCenterFocusWeak: __MaterialUI.SvgIcon; + export var ImageCollectionsBookmark: __MaterialUI.SvgIcon; + export var ImageCollections: __MaterialUI.SvgIcon; + export var ImageColorLens: __MaterialUI.SvgIcon; + export var ImageColorize: __MaterialUI.SvgIcon; + export var ImageCompare: __MaterialUI.SvgIcon; + export var ImageControlPointDuplicate: __MaterialUI.SvgIcon; + export var ImageControlPoint: __MaterialUI.SvgIcon; + export var ImageCrop169: __MaterialUI.SvgIcon; + export var ImageCrop32: __MaterialUI.SvgIcon; + export var ImageCrop54: __MaterialUI.SvgIcon; + export var ImageCrop75: __MaterialUI.SvgIcon; + export var ImageCropDin: __MaterialUI.SvgIcon; + export var ImageCropFree: __MaterialUI.SvgIcon; + export var ImageCropLandscape: __MaterialUI.SvgIcon; + export var ImageCropOriginal: __MaterialUI.SvgIcon; + export var ImageCropPortrait: __MaterialUI.SvgIcon; + export var ImageCropRotate: __MaterialUI.SvgIcon; + export var ImageCropSquare: __MaterialUI.SvgIcon; + export var ImageCrop: __MaterialUI.SvgIcon; + export var ImageDehaze: __MaterialUI.SvgIcon; + export var ImageDetails: __MaterialUI.SvgIcon; + export var ImageEdit: __MaterialUI.SvgIcon; + export var ImageExposureNeg1: __MaterialUI.SvgIcon; + export var ImageExposureNeg2: __MaterialUI.SvgIcon; + export var ImageExposurePlus1: __MaterialUI.SvgIcon; + export var ImageExposurePlus2: __MaterialUI.SvgIcon; + export var ImageExposureZero: __MaterialUI.SvgIcon; + export var ImageExposure: __MaterialUI.SvgIcon; + export var ImageFilter1: __MaterialUI.SvgIcon; + export var ImageFilter2: __MaterialUI.SvgIcon; + export var ImageFilter3: __MaterialUI.SvgIcon; + export var ImageFilter4: __MaterialUI.SvgIcon; + export var ImageFilter5: __MaterialUI.SvgIcon; + export var ImageFilter6: __MaterialUI.SvgIcon; + export var ImageFilter7: __MaterialUI.SvgIcon; + export var ImageFilter8: __MaterialUI.SvgIcon; + export var ImageFilter9Plus: __MaterialUI.SvgIcon; + export var ImageFilter9: __MaterialUI.SvgIcon; + export var ImageFilterBAndW: __MaterialUI.SvgIcon; + export var ImageFilterCenterFocus: __MaterialUI.SvgIcon; + export var ImageFilterDrama: __MaterialUI.SvgIcon; + export var ImageFilterFrames: __MaterialUI.SvgIcon; + export var ImageFilterHdr: __MaterialUI.SvgIcon; + export var ImageFilterNone: __MaterialUI.SvgIcon; + export var ImageFilterTiltShift: __MaterialUI.SvgIcon; + export var ImageFilterVintage: __MaterialUI.SvgIcon; + export var ImageFilter: __MaterialUI.SvgIcon; + export var ImageFlare: __MaterialUI.SvgIcon; + export var ImageFlashAuto: __MaterialUI.SvgIcon; + export var ImageFlashOff: __MaterialUI.SvgIcon; + export var ImageFlashOn: __MaterialUI.SvgIcon; + export var ImageFlip: __MaterialUI.SvgIcon; + export var ImageGradient: __MaterialUI.SvgIcon; + export var ImageGrain: __MaterialUI.SvgIcon; + export var ImageGridOff: __MaterialUI.SvgIcon; + export var ImageGridOn: __MaterialUI.SvgIcon; + export var ImageHdrOff: __MaterialUI.SvgIcon; + export var ImageHdrOn: __MaterialUI.SvgIcon; + export var ImageHdrStrong: __MaterialUI.SvgIcon; + export var ImageHdrWeak: __MaterialUI.SvgIcon; + export var ImageHealing: __MaterialUI.SvgIcon; + export var ImageImageAspectRatio: __MaterialUI.SvgIcon; + export var ImageImage: __MaterialUI.SvgIcon; + export var ImageIso: __MaterialUI.SvgIcon; + export var ImageLandscape: __MaterialUI.SvgIcon; + export var ImageLeakAdd: __MaterialUI.SvgIcon; + export var ImageLeakRemove: __MaterialUI.SvgIcon; + export var ImageLens: __MaterialUI.SvgIcon; + export var ImageLinkedCamera: __MaterialUI.SvgIcon; + export var ImageLooks3: __MaterialUI.SvgIcon; + export var ImageLooks4: __MaterialUI.SvgIcon; + export var ImageLooks5: __MaterialUI.SvgIcon; + export var ImageLooks6: __MaterialUI.SvgIcon; + export var ImageLooksOne: __MaterialUI.SvgIcon; + export var ImageLooksTwo: __MaterialUI.SvgIcon; + export var ImageLooks: __MaterialUI.SvgIcon; + export var ImageLoupe: __MaterialUI.SvgIcon; + export var ImageMonochromePhotos: __MaterialUI.SvgIcon; + export var ImageMovieCreation: __MaterialUI.SvgIcon; + export var ImageMovieFilter: __MaterialUI.SvgIcon; + export var ImageMusicNote: __MaterialUI.SvgIcon; + export var ImageNaturePeople: __MaterialUI.SvgIcon; + export var ImageNature: __MaterialUI.SvgIcon; + export var ImageNavigateBefore: __MaterialUI.SvgIcon; + export var ImageNavigateNext: __MaterialUI.SvgIcon; + export var ImagePalette: __MaterialUI.SvgIcon; + export var ImagePanoramaFishEye: __MaterialUI.SvgIcon; + export var ImagePanoramaHorizontal: __MaterialUI.SvgIcon; + export var ImagePanoramaVertical: __MaterialUI.SvgIcon; + export var ImagePanoramaWideAngle: __MaterialUI.SvgIcon; + export var ImagePanorama: __MaterialUI.SvgIcon; + export var ImagePhotoAlbum: __MaterialUI.SvgIcon; + export var ImagePhotoCamera: __MaterialUI.SvgIcon; + export var ImagePhotoFilter: __MaterialUI.SvgIcon; + export var ImagePhotoLibrary: __MaterialUI.SvgIcon; + export var ImagePhotoSizeSelectActual: __MaterialUI.SvgIcon; + export var ImagePhotoSizeSelectLarge: __MaterialUI.SvgIcon; + export var ImagePhotoSizeSelectSmall: __MaterialUI.SvgIcon; + export var ImagePhoto: __MaterialUI.SvgIcon; + export var ImagePictureAsPdf: __MaterialUI.SvgIcon; + export var ImagePortrait: __MaterialUI.SvgIcon; + export var ImageRemoveRedEye: __MaterialUI.SvgIcon; + export var ImageRotate90DegreesCcw: __MaterialUI.SvgIcon; + export var ImageRotateLeft: __MaterialUI.SvgIcon; + export var ImageRotateRight: __MaterialUI.SvgIcon; + export var ImageSlideshow: __MaterialUI.SvgIcon; + export var ImageStraighten: __MaterialUI.SvgIcon; + export var ImageStyle: __MaterialUI.SvgIcon; + export var ImageSwitchCamera: __MaterialUI.SvgIcon; + export var ImageSwitchVideo: __MaterialUI.SvgIcon; + export var ImageTagFaces: __MaterialUI.SvgIcon; + export var ImageTexture: __MaterialUI.SvgIcon; + export var ImageTimelapse: __MaterialUI.SvgIcon; + export var ImageTimer10: __MaterialUI.SvgIcon; + export var ImageTimer3: __MaterialUI.SvgIcon; + export var ImageTimerOff: __MaterialUI.SvgIcon; + export var ImageTimer: __MaterialUI.SvgIcon; + export var ImageTonality: __MaterialUI.SvgIcon; + export var ImageTransform: __MaterialUI.SvgIcon; + export var ImageTune: __MaterialUI.SvgIcon; + export var ImageViewComfy: __MaterialUI.SvgIcon; + export var ImageViewCompact: __MaterialUI.SvgIcon; + export var ImageVignette: __MaterialUI.SvgIcon; + export var ImageWbAuto: __MaterialUI.SvgIcon; + export var ImageWbCloudy: __MaterialUI.SvgIcon; + export var ImageWbIncandescent: __MaterialUI.SvgIcon; + export var ImageWbIridescent: __MaterialUI.SvgIcon; + export var ImageWbSunny: __MaterialUI.SvgIcon; + export var MapsAddLocation: __MaterialUI.SvgIcon; + export var MapsBeenhere: __MaterialUI.SvgIcon; + export var MapsDirectionsBike: __MaterialUI.SvgIcon; + export var MapsDirectionsBoat: __MaterialUI.SvgIcon; + export var MapsDirectionsBus: __MaterialUI.SvgIcon; + export var MapsDirectionsCar: __MaterialUI.SvgIcon; + export var MapsDirectionsRailway: __MaterialUI.SvgIcon; + export var MapsDirectionsRun: __MaterialUI.SvgIcon; + export var MapsDirectionsSubway: __MaterialUI.SvgIcon; + export var MapsDirectionsTransit: __MaterialUI.SvgIcon; + export var MapsDirectionsWalk: __MaterialUI.SvgIcon; + export var MapsDirections: __MaterialUI.SvgIcon; + export var MapsEditLocation: __MaterialUI.SvgIcon; + export var MapsFlight: __MaterialUI.SvgIcon; + export var MapsHotel: __MaterialUI.SvgIcon; + export var MapsLayersClear: __MaterialUI.SvgIcon; + export var MapsLayers: __MaterialUI.SvgIcon; + export var MapsLocalActivity: __MaterialUI.SvgIcon; + export var MapsLocalAirport: __MaterialUI.SvgIcon; + export var MapsLocalAtm: __MaterialUI.SvgIcon; + export var MapsLocalBar: __MaterialUI.SvgIcon; + export var MapsLocalCafe: __MaterialUI.SvgIcon; + export var MapsLocalCarWash: __MaterialUI.SvgIcon; + export var MapsLocalConvenienceStore: __MaterialUI.SvgIcon; + export var MapsLocalDining: __MaterialUI.SvgIcon; + export var MapsLocalDrink: __MaterialUI.SvgIcon; + export var MapsLocalFlorist: __MaterialUI.SvgIcon; + export var MapsLocalGasStation: __MaterialUI.SvgIcon; + export var MapsLocalGroceryStore: __MaterialUI.SvgIcon; + export var MapsLocalHospital: __MaterialUI.SvgIcon; + export var MapsLocalHotel: __MaterialUI.SvgIcon; + export var MapsLocalLaundryService: __MaterialUI.SvgIcon; + export var MapsLocalLibrary: __MaterialUI.SvgIcon; + export var MapsLocalMall: __MaterialUI.SvgIcon; + export var MapsLocalMovies: __MaterialUI.SvgIcon; + export var MapsLocalOffer: __MaterialUI.SvgIcon; + export var MapsLocalParking: __MaterialUI.SvgIcon; + export var MapsLocalPharmacy: __MaterialUI.SvgIcon; + export var MapsLocalPhone: __MaterialUI.SvgIcon; + export var MapsLocalPizza: __MaterialUI.SvgIcon; + export var MapsLocalPlay: __MaterialUI.SvgIcon; + export var MapsLocalPostOffice: __MaterialUI.SvgIcon; + export var MapsLocalPrintshop: __MaterialUI.SvgIcon; + export var MapsLocalSee: __MaterialUI.SvgIcon; + export var MapsLocalShipping: __MaterialUI.SvgIcon; + export var MapsLocalTaxi: __MaterialUI.SvgIcon; + export var MapsMap: __MaterialUI.SvgIcon; + export var MapsMyLocation: __MaterialUI.SvgIcon; + export var MapsNavigation: __MaterialUI.SvgIcon; + export var MapsNearMe: __MaterialUI.SvgIcon; + export var MapsPersonPinCircle: __MaterialUI.SvgIcon; + export var MapsPersonPin: __MaterialUI.SvgIcon; + export var MapsPinDrop: __MaterialUI.SvgIcon; + export var MapsPlace: __MaterialUI.SvgIcon; + export var MapsRateReview: __MaterialUI.SvgIcon; + export var MapsRestaurantMenu: __MaterialUI.SvgIcon; + export var MapsSatellite: __MaterialUI.SvgIcon; + export var MapsStoreMallDirectory: __MaterialUI.SvgIcon; + export var MapsTerrain: __MaterialUI.SvgIcon; + export var MapsTraffic: __MaterialUI.SvgIcon; + export var MapsZoomOutMap: __MaterialUI.SvgIcon; + export var NavigationApps: __MaterialUI.SvgIcon; + export var NavigationArrowBack: __MaterialUI.SvgIcon; + export var NavigationArrowDownward: __MaterialUI.SvgIcon; + export var NavigationArrowDropDownCircle: __MaterialUI.SvgIcon; + export var NavigationArrowDropDown: __MaterialUI.SvgIcon; + export var NavigationArrowDropUp: __MaterialUI.SvgIcon; + export var NavigationArrowForward: __MaterialUI.SvgIcon; + export var NavigationArrowUpward: __MaterialUI.SvgIcon; + export var NavigationCancel: __MaterialUI.SvgIcon; + export var NavigationCheck: __MaterialUI.SvgIcon; + export var NavigationChevronLeft: __MaterialUI.SvgIcon; + export var NavigationChevronRight: __MaterialUI.SvgIcon; + export var NavigationClose: __MaterialUI.SvgIcon; + export var NavigationExpandLess: __MaterialUI.SvgIcon; + export var NavigationExpandMore: __MaterialUI.SvgIcon; + export var NavigationFullscreenExit: __MaterialUI.SvgIcon; + export var NavigationFullscreen: __MaterialUI.SvgIcon; + export var NavigationMenu: __MaterialUI.SvgIcon; + export var NavigationMoreHoriz: __MaterialUI.SvgIcon; + export var NavigationMoreVert: __MaterialUI.SvgIcon; + export var NavigationRefresh: __MaterialUI.SvgIcon; + export var NavigationSubdirectoryArrowLeft: __MaterialUI.SvgIcon; + export var NavigationSubdirectoryArrowRight: __MaterialUI.SvgIcon; + export var NavigationUnfoldLess: __MaterialUI.SvgIcon; + export var NavigationUnfoldMore: __MaterialUI.SvgIcon; + export var NavigationArrowDropRight: __MaterialUI.SvgIcon; + export var NotificationAdb: __MaterialUI.SvgIcon; + export var NotificationAirlineSeatFlatAngled: __MaterialUI.SvgIcon; + export var NotificationAirlineSeatFlat: __MaterialUI.SvgIcon; + export var NotificationAirlineSeatIndividualSuite: __MaterialUI.SvgIcon; + export var NotificationAirlineSeatLegroomExtra: __MaterialUI.SvgIcon; + export var NotificationAirlineSeatLegroomNormal: __MaterialUI.SvgIcon; + export var NotificationAirlineSeatLegroomReduced: __MaterialUI.SvgIcon; + export var NotificationAirlineSeatReclineExtra: __MaterialUI.SvgIcon; + export var NotificationAirlineSeatReclineNormal: __MaterialUI.SvgIcon; + export var NotificationBluetoothAudio: __MaterialUI.SvgIcon; + export var NotificationConfirmationNumber: __MaterialUI.SvgIcon; + export var NotificationDiscFull: __MaterialUI.SvgIcon; + export var NotificationDoNotDisturbAlt: __MaterialUI.SvgIcon; + export var NotificationDoNotDisturb: __MaterialUI.SvgIcon; + export var NotificationDriveEta: __MaterialUI.SvgIcon; + export var NotificationEnhancedEncryption: __MaterialUI.SvgIcon; + export var NotificationEventAvailable: __MaterialUI.SvgIcon; + export var NotificationEventBusy: __MaterialUI.SvgIcon; + export var NotificationEventNote: __MaterialUI.SvgIcon; + export var NotificationFolderSpecial: __MaterialUI.SvgIcon; + export var NotificationLiveTv: __MaterialUI.SvgIcon; + export var NotificationMms: __MaterialUI.SvgIcon; + export var NotificationMore: __MaterialUI.SvgIcon; + export var NotificationNetworkCheck: __MaterialUI.SvgIcon; + export var NotificationNetworkLocked: __MaterialUI.SvgIcon; + export var NotificationNoEncryption: __MaterialUI.SvgIcon; + export var NotificationOndemandVideo: __MaterialUI.SvgIcon; + export var NotificationPersonalVideo: __MaterialUI.SvgIcon; + export var NotificationPhoneBluetoothSpeaker: __MaterialUI.SvgIcon; + export var NotificationPhoneForwarded: __MaterialUI.SvgIcon; + export var NotificationPhoneInTalk: __MaterialUI.SvgIcon; + export var NotificationPhoneLocked: __MaterialUI.SvgIcon; + export var NotificationPhoneMissed: __MaterialUI.SvgIcon; + export var NotificationPhonePaused: __MaterialUI.SvgIcon; + export var NotificationPower: __MaterialUI.SvgIcon; + export var NotificationRvHookup: __MaterialUI.SvgIcon; + export var NotificationSdCard: __MaterialUI.SvgIcon; + export var NotificationSimCardAlert: __MaterialUI.SvgIcon; + export var NotificationSmsFailed: __MaterialUI.SvgIcon; + export var NotificationSms: __MaterialUI.SvgIcon; + export var NotificationSyncDisabled: __MaterialUI.SvgIcon; + export var NotificationSyncProblem: __MaterialUI.SvgIcon; + export var NotificationSync: __MaterialUI.SvgIcon; + export var NotificationSystemUpdate: __MaterialUI.SvgIcon; + export var NotificationTapAndPlay: __MaterialUI.SvgIcon; + export var NotificationTimeToLeave: __MaterialUI.SvgIcon; + export var NotificationVibration: __MaterialUI.SvgIcon; + export var NotificationVoiceChat: __MaterialUI.SvgIcon; + export var NotificationVpnLock: __MaterialUI.SvgIcon; + export var NotificationWc: __MaterialUI.SvgIcon; + export var NotificationWifi: __MaterialUI.SvgIcon; + export var PlacesAcUnit: __MaterialUI.SvgIcon; + export var PlacesAirportShuttle: __MaterialUI.SvgIcon; + export var PlacesAllInclusive: __MaterialUI.SvgIcon; + export var PlacesBeachAccess: __MaterialUI.SvgIcon; + export var PlacesBusinessCenter: __MaterialUI.SvgIcon; + export var PlacesCasino: __MaterialUI.SvgIcon; + export var PlacesChildCare: __MaterialUI.SvgIcon; + export var PlacesChildFriendly: __MaterialUI.SvgIcon; + export var PlacesFitnessCenter: __MaterialUI.SvgIcon; + export var PlacesFreeBreakfast: __MaterialUI.SvgIcon; + export var PlacesGolfCourse: __MaterialUI.SvgIcon; + export var PlacesHotTub: __MaterialUI.SvgIcon; + export var PlacesKitchen: __MaterialUI.SvgIcon; + export var PlacesPool: __MaterialUI.SvgIcon; + export var PlacesRoomService: __MaterialUI.SvgIcon; + export var PlacesSmokeFree: __MaterialUI.SvgIcon; + export var PlacesSmokingRooms: __MaterialUI.SvgIcon; + export var PlacesSpa: __MaterialUI.SvgIcon; + export var SocialCake: __MaterialUI.SvgIcon; + export var SocialDomain: __MaterialUI.SvgIcon; + export var SocialGroupAdd: __MaterialUI.SvgIcon; + export var SocialGroup: __MaterialUI.SvgIcon; + export var SocialLocationCity: __MaterialUI.SvgIcon; + export var SocialMoodBad: __MaterialUI.SvgIcon; + export var SocialMood: __MaterialUI.SvgIcon; + export var SocialNotificationsActive: __MaterialUI.SvgIcon; + export var SocialNotificationsNone: __MaterialUI.SvgIcon; + export var SocialNotificationsOff: __MaterialUI.SvgIcon; + export var SocialNotificationsPaused: __MaterialUI.SvgIcon; + export var SocialNotifications: __MaterialUI.SvgIcon; + export var SocialPages: __MaterialUI.SvgIcon; + export var SocialPartyMode: __MaterialUI.SvgIcon; + export var SocialPeopleOutline: __MaterialUI.SvgIcon; + export var SocialPeople: __MaterialUI.SvgIcon; + export var SocialPersonAdd: __MaterialUI.SvgIcon; + export var SocialPersonOutline: __MaterialUI.SvgIcon; + export var SocialPerson: __MaterialUI.SvgIcon; + export var SocialPlusOne: __MaterialUI.SvgIcon; + export var SocialPoll: __MaterialUI.SvgIcon; + export var SocialPublic: __MaterialUI.SvgIcon; + export var SocialSchool: __MaterialUI.SvgIcon; + export var SocialShare: __MaterialUI.SvgIcon; + export var SocialWhatshot: __MaterialUI.SvgIcon; + export var ToggleCheckBoxOutlineBlank: __MaterialUI.SvgIcon; + export var ToggleCheckBox: __MaterialUI.SvgIcon; + export var ToggleIndeterminateCheckBox: __MaterialUI.SvgIcon; + export var ToggleRadioButtonChecked: __MaterialUI.SvgIcon; + export var ToggleRadioButtonUnchecked: __MaterialUI.SvgIcon; + export var ToggleStarBorder: __MaterialUI.SvgIcon; + export var ToggleStarHalf: __MaterialUI.SvgIcon; + export var ToggleStar: __MaterialUI.SvgIcon; +} \ No newline at end of file diff --git a/material-ui/material-ui-tests.tsx b/material-ui/material-ui-tests.tsx index ffd9b1814..7d2a0f139 100644 --- a/material-ui/material-ui-tests.tsx +++ b/material-ui/material-ui-tests.tsx @@ -4,46 +4,109 @@ import * as React from "react"; import * as LinkedStateMixin from "react-addons-linked-state-mixin"; -import Checkbox = require("material-ui/lib/checkbox"); -import Colors = require("material-ui/lib/styles/colors"); -import Spacing = require("material-ui/lib/styles/spacing"); -import AppBar = require("material-ui/lib/app-bar"); -import Badge = require("material-ui/lib/badge"); -import IconButton = require("material-ui/lib/icon-button"); -import FlatButton = require("material-ui/lib/flat-button"); -import Avatar = require("material-ui/lib/avatar"); -import FontIcon = require("material-ui/lib/font-icon"); -import Typography = require("material-ui/lib/styles/typography"); -import RaisedButton = require("material-ui/lib/raised-button"); -import FloatingActionButton = require("material-ui/lib/floating-action-button"); -import Card = require("material-ui/lib/card/card"); -import CardHeader = require("material-ui/lib/card/card-header"); -import CardText = require("material-ui/lib/card/card-text"); -import CardActions = require("material-ui/lib/card/card-actions"); -import Dialog = require("material-ui/lib/dialog"); -import DropDownMenu = require("material-ui/lib/drop-down-menu"); -import DatePicker = require("material-ui/lib/date-picker/date-picker"); -import TimePicker = require("material-ui/lib/time-picker"); -import RadioButtonGroup = require("material-ui/lib/radio-button-group"); -import RadioButton = require("material-ui/lib/radio-button"); -import Toggle = require("material-ui/lib/toggle"); -import TextField = require("material-ui/lib/text-field"); -import SelectField = require("material-ui/lib/select-field"); -import IconMenu = require("material-ui/lib/menus/icon-menu"); -import Menu = require('material-ui/lib/menus/menu'); -import MenuItem = require('material-ui/lib/menus/menu-item'); -import MenuDivider = require('material-ui/lib/menus/menu-divider'); -import ThemeManager = require('material-ui/lib/styles/theme-manager'); -import GridList = require('material-ui/lib/grid-list/grid-list'); -import GridTile = require('material-ui/lib/grid-list/grid-tile'); +import * as MaterialUi from "material-ui"; +import ActionGrade from "material-ui/lib/svg-icons/action/grade"; +import AppBar from "material-ui/lib/app-bar"; +import ArrowDropRight from "material-ui/lib/svg-icons/navigation-arrow-drop-right"; +import AutoComplete from 'material-ui/lib/auto-complete'; +import Avatar from "material-ui/lib/avatar"; +import Badge from "material-ui/lib/badge"; +import Card from "material-ui/lib/card/card"; +import CardActions from "material-ui/lib/card/card-actions"; +import CardHeader from "material-ui/lib/card/card-header"; +import CardMedia from 'material-ui/lib/card/card-media'; +import CardText from "material-ui/lib/card/card-text"; +import CardTitle from 'material-ui/lib/card/card-title'; +import Checkbox from "material-ui/lib/checkbox"; +import CircularProgress from 'material-ui/lib/circular-progress'; +import ColorManipulator from 'material-ui/lib/utils/color-manipulator'; +import Colors from "material-ui/lib/styles/colors"; +import DatePicker from "material-ui/lib/date-picker/date-picker"; +import Dialog from "material-ui/lib/dialog"; +import Divider from 'material-ui/lib/divider'; +import DropDownMenu from "material-ui/lib/drop-down-menu"; +import FileFolder from "material-ui/lib/svg-icons/file/folder"; +import FlatButton from "material-ui/lib/flat-button"; +import FloatingActionButton from "material-ui/lib/floating-action-button"; +import FontIcon from "material-ui/lib/font-icon"; +import GridList from 'material-ui/lib/grid-list/grid-list'; +import GridTile from 'material-ui/lib/grid-list/grid-tile'; +import IconButton from "material-ui/lib/icon-button"; +import IconMenu from "material-ui/lib/menus/icon-menu"; +import LeftNav from 'material-ui/lib/left-nav'; +import LinearProgress from 'material-ui/lib/linear-progress'; +import List from 'material-ui/lib/lists/list'; +import ListItem from 'material-ui/lib/lists/list-item'; +import Menu from 'material-ui/lib/menus/menu'; +import MenuItem from 'material-ui/lib/menus/menu-item'; +import Paper from 'material-ui/lib/paper'; +import Popover from 'material-ui/lib/popover/popover'; +import PopoverAnimationFromTop from 'material-ui/lib/popover/popover-animation-from-top'; +import RadioButton from "material-ui/lib/radio-button"; +import RadioButtonGroup from "material-ui/lib/radio-button-group"; +import RaisedButton from "material-ui/lib/raised-button"; +import RefreshIndicator from 'material-ui/lib/refresh-indicator'; +import SelectField from "material-ui/lib/select-field"; +import Slider from 'material-ui/lib/slider'; +import Snackbar from 'material-ui/lib/snackbar'; +import Spacing from "material-ui/lib/styles/spacing"; +import Styles from 'material-ui/lib/styles'; +import SvgIcon from 'material-ui/lib/svg-icon'; +import Tab from 'material-ui/lib/tabs/tab'; +import Table from 'material-ui/lib/table/table'; +import TableBody from 'material-ui/lib/table/table-body'; +import TableFooter from 'material-ui/lib/table/table-footer'; +import TableHeader from 'material-ui/lib/table/table-header'; +import TableHeaderColumn from 'material-ui/lib/table/table-header-column'; +import TableRow from 'material-ui/lib/table/table-row'; +import TableRowColumn from 'material-ui/lib/table/table-row-column'; +import Tabs from 'material-ui/lib/tabs/tabs'; +import TextField from "material-ui/lib/text-field"; +import ThemeDecorator from 'material-ui/lib/styles/theme-decorator'; +import ThemeManager from 'material-ui/lib/styles/theme-manager'; +import TimePicker from "material-ui/lib/time-picker"; +import Toggle from "material-ui/lib/toggle"; +import ToggleStar from "material-ui/lib/svg-icons/toggle/star"; +import ToggleStarBorder from "material-ui/lib/svg-icons/toggle/star-border"; +import Toolbar from 'material-ui/lib/toolbar/toolbar'; +import ToolbarGroup from 'material-ui/lib/toolbar/toolbar-group'; +import ToolbarSeparator from 'material-ui/lib/toolbar/toolbar-separator'; +import ToolbarTitle from 'material-ui/lib/toolbar/toolbar-title'; +import Typography from "material-ui/lib/styles/typography"; +import zIndex from 'material-ui/lib/styles/zIndex'; +import {SelectableContainerEnhance} from 'material-ui/lib/hoc/selectable-enhance'; + +import * as Icons from "material-ui/lib/svg-icons"; +import ActionAndroid from 'material-ui/lib/svg-icons/action/android'; +import ActionFavorite from 'material-ui/lib/svg-icons/action/favorite'; +import ActionFavoriteBorder from 'material-ui/lib/svg-icons/action/favorite-border'; +import ActionFlightTakeoff from 'material-ui/lib/svg-icons/action/flight-takeoff'; +import ActionHome from 'material-ui/lib/svg-icons/action/home'; +import ActionInfo from 'material-ui/lib/svg-icons/action/info'; +import CommunicationChatBubble from 'material-ui/lib/svg-icons/communication/chat-bubble'; +import ContentAdd from 'material-ui/lib/svg-icons/content/add'; +import ContentCopy from 'material-ui/lib/svg-icons/content/content-copy'; +import ContentDrafts from 'material-ui/lib/svg-icons/content/drafts'; +import ContentFilter from 'material-ui/lib/svg-icons/content/filter-list'; +import ContentInbox from 'material-ui/lib/svg-icons/content/inbox'; +import ContentLink from 'material-ui/lib/svg-icons/content/link'; +import ContentSend from 'material-ui/lib/svg-icons/content/send'; +import Delete from 'material-ui/lib/svg-icons/action/delete'; +import Download from 'material-ui/lib/svg-icons/file/file-download'; +import FileCloudDownload from 'material-ui/lib/svg-icons/file/cloud-download'; +import FolderIcon from 'material-ui/lib/svg-icons/file/folder-open'; +import HardwareVideogameAsset from 'material-ui/lib/svg-icons/hardware/videogame-asset'; +import MapsPlace from 'material-ui/lib/svg-icons/maps/place'; +import MoreVertIcon from 'material-ui/lib/svg-icons/navigation/more-vert'; +import NavigationClose from "material-ui/lib/svg-icons/navigation/close"; +import NavigationExpandMoreIcon from 'material-ui/lib/svg-icons/navigation/expand-more'; +import NotificationsIcon from 'material-ui/lib/svg-icons/social/notifications'; +import PersonAdd from 'material-ui/lib/svg-icons/social/person-add'; +import RemoveRedEye from 'material-ui/lib/svg-icons/image/remove-red-eye'; +import StarBorder from 'material-ui/lib/svg-icons/toggle/star-border'; +import UploadIcon from 'material-ui/lib/svg-icons/file/cloud-upload'; -import NavigationClose = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/navigation/close", but they aren't defined yet. -import FileFolder = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/file/folder", but they aren't defined yet. -import ToggleStar = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/toggle/star", but they aren't defined yet. -import ActionGrade = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/action/grade", but they aren't defined yet. -import ToggleStarBorder = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/toggle/star-border", but they aren't defined yet. -import ArrowDropRight = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/toggle/star-border", but they aren't defined yet. type CheckboxProps = __MaterialUI.CheckboxProps; type MuiTheme = __MaterialUI.Styles.MuiTheme; @@ -53,16 +116,64 @@ interface MaterialUiTestsState { showDialogStandardActions: boolean; showDialogCustomActions: boolean; showDialogScrollable: boolean; + value: number; + dataSource: [string]; + minDate: Date; + maxDate: Date; + autoOk: boolean; + disableYearSelection: boolean; + open: boolean; + valueSingle: string; + valueMultiple: string[]; + anchorEl: Element; + completed: number; + message: string; + autoHideDuration: number; + fixedHeader: boolean; + fixedFooter: boolean; + stripedRows: boolean; + showRowHover: boolean; + selectable: boolean; + multiSelectable: boolean; + enableSelectAll: boolean; + deselectOnClickaway: boolean; + height: string; } +// "http://www.material-ui.com/#/customization/themes" +let muiTheme: MuiTheme = ThemeManager.getMuiTheme({ + spacing: Spacing, + zIndex: zIndex, + fontFamily: 'Roboto, sans-serif', + palette: { + primary1Color: Colors.cyan500, + primary2Color: Colors.cyan700, + primary3Color: Colors.lightBlack, + accent1Color: Colors.pinkA200, + accent2Color: Colors.grey100, + accent3Color: Colors.grey500, + textColor: Colors.darkBlack, + alternateTextColor: Colors.white, + canvasColor: Colors.white, + borderColor: Colors.grey300, + disabledColor: ColorManipulator.fade(Colors.darkBlack, 0.3), + pickerHeaderColor: Colors.cyan500, + } +}); + +let SelectableList = SelectableContainerEnhance(List); + +@ThemeDecorator(muiTheme) class MaterialUiTests extends React.Component<{}, MaterialUiTestsState> implements React.LinkedStateMixin { // injected with mixin linkState: (key: string) => React.ReactLink; - dialog: Dialog; + + private picker12hr: TimePicker; + private picker24hr: TimePicker; private touchTapEventHandler(e: TouchTapEvent) { - this.dialog.show(); + console.info("Received touch tap", e); } private formEventHandler(e: React.FormEvent) { } @@ -70,20 +181,160 @@ class MaterialUiTests extends React.Component<{}, MaterialUiTestsState> implemen } private handleRequestClose(buttonClicked: boolean) { } + private handleRequestCloseReason(reason: string) { + } + private handleToggle() { + this.setState(Object.assign({}, this.state, { open: !this.state.open })); + } + private handleClose() { + this.setState(Object.assign({}, this.state, { open: false })); + } + private handleChangeSingle(event: React.MouseEvent, value: string){ + } + private handleChangeMultiple(event: React.MouseEvent, value: string[]) { + } + + private handleChange = (e: TouchTapEvent, index: number, value: number) => this.setState(Object.assign({}, this.state, { value })); + + private handleUpdateInput(t: string) { + this.setState(Object.assign({}, this.state, { + dataSource: [t, t + t, t + t + t], + })); + } + private handleTouchTap(e: TouchTapEvent) { + alert('onTouchTap triggered on the title component'); + } + private handleActionTouchTap() { + this.setState(Object.assign({}, this.state, {open: false,})); + alert('Event removed from your calendar.'); + } + private handleChangeDuration = (event: React.FormEvent) => { + const value = event.target["value"]; + this.setState(Object.assign({}, this.state, { + autoHideDuration: value.length > 0 ? parseInt(value) : 0, + })); + } + private onRowSelection(selectedRows: number[] | string) { + } + private handleActive(tab: Tab) { + alert(`A tab with this route property ${tab.props.value} was activated.`); + } + private handleChangeTabs(value: any, e: React.FormEvent, tab: Tab) { + } + private handleChangeTimePicker12(err, time) { + this.picker12hr.setTime(time); + }; + + private handleChangeTimePicker24(err, time) { + this.picker24hr.setTime(time); + }; render() { - // "http://material-ui.com/#/customization/themes" - let muiTheme: MuiTheme = ThemeManager.getMuiTheme({ - palette: { - accent1Color: Colors.cyan100 + const styles = { + title: { + cursor: 'pointer', }, - spacing: { + exampleImageInput: { + cursor: 'pointer', + position: 'absolute', + top: 0, + bottom: 0, + right: 0, + left: 0, + width: '100%', + opacity: 0, + }, + button: { + margin: 12, + }, + floatingButton: { + marginRight: 20, + }, + textField: { + marginLeft: 20, + }, + floatLeft: { + float: 'left', + }, + root: { + display: 'flex', + flexWrap: 'wrap', + justifyContent: 'space-around', + }, + gridList: { + width: 500, + height: 400, + overflowY: 'auto', + marginBottom: 24, + }, + icons: { + marginRight: 24, + }, + menu: { + marginRight: 32, + marginBottom: 32, + float: 'left', + position: 'relative', + zIndex: 0, + }, + rightIcon: { + textAlign: 'center', + lineHeight: '24px', + }, + paper: { + height: 100, + width: 100, + margin: 20, + textAlign: 'center', + display: 'inline-block', + }, + popover: { + padding: 20, + }, + container: { + position: 'relative', + }, + refresh: { + display: 'inline-block', + position: 'relative', + }, + block: { + maxWidth: 250, + }, + checkbox: { + marginBottom: 16, + }, + radioButton: { + marginBottom: 16, + }, + toggle: { + marginBottom: 16, + }, + propContainerStyle: { + width: 200, + overflow: 'hidden', + margin: '20px auto 0', + }, + propToggleHeader: { + margin: '20px auto 10px', + }, + headline: { + fontSize: 24, + paddingTop: 16, + marginBottom: 12, + fontWeight: 400, + }, + errorStyle: { + color: Colors.orange500, + }, + underlineStyle: { + borderColor: Colors.orange500, + }, + }; + const colors = Styles.Colors; - } - }); - - // "http://material-ui.com/#/customization/inline-styles" + // "http://www.material-ui.com/#/customization/inline-styles" let element: React.ReactElement; element = implemen } }); - // "http://material-ui.com/#/components/appbar" - element = - element = } - iconElementRight={} />; + // "http://www.material-ui.com/#/components/app-bar" + const AppBarExampleIcon = () => ( + + ); + + const AppBarExampleIconButton = () => ( + Title} + onTitleTouchTap={this.handleTouchTap} + iconElementLeft={} + iconElementRight={} + /> + ); + const AppBarExampleIconMenu = () => ( + } + iconElementRight={ + + } + targetOrigin={{ horizontal: 'right', vertical: 'top' }} + anchorOrigin={{ horizontal: 'right', vertical: 'top' }} + > + + + + + } + /> + ); + + // "http://www.material-ui.com/#/components/auto-complete" + element = + + const dataSource1 = [ + { + text: 'text-value1', + value: ( + + ), + }, + { + text: 'text-value2', + value: ( + + ), + }, + ]; + + const dataSource2 = ['12345', '23456', '34567']; + + const AutoCompleteExampleNoFilter = () => ( +
+
+ +
+ ); + + const AutoCompleteExampleFilters = () => ( +
+ +
+ +
+ ); + + // "http://www.material-ui.com/#/components/avatar" + const AvatarExampleSimple = () => ( + + + } + > + Image Avatar + + } /> + } + > + FontIcon Avatar + + } + color={colors.blue300} + backgroundColor={colors.indigo900} + /> + } + > + FontIcon Avatar with custom colors + + } /> + } + > + SvgIcon Avatar + + } + color={colors.orange200} + backgroundColor={colors.pink400} + /> + } + > + SvgIcon Avatar with custom colors + + A} + > + Letter Avatar + + + A + + } + > + Letter Avatar with custom colors + + + ); - // "http://material-ui.com/#/components/avatars" //image avatar element = ; //SvgIcon avatar @@ -143,60 +555,307 @@ class MaterialUiTests extends React.Component<{}, MaterialUiTestsState> implemen backgroundColor={Colors.purple500}> - // "http://material-ui.com/#/components/badge" - element = Hello}> - - ; - element = Hello} - badgeStyle={{height: '24px', width: '24px'}} - > - This text has a badge! - ; + // "http://www.material-ui.com/#/components/badge" + const BadgeExampleSimple = () => ( +
+ + + + + + + + +
+ ); + const BadgeExampleContent = () => ( +
+ } + > + + + + Company Name + +
+ ); - // "http://material-ui.com/#/components/buttons" - element = - - ; - element = - - ; - element = - - ; + // "http://www.material-ui.com/#/components/flat-button" + const FlatButtonExampleSimple = () => ( +
+ + + + +
+ ); + const FlatButtonExampleComplex = () => ( +
+ + + - // "http://material-ui.com/#/components/cards" - element = - A} - showExpandableButton={true}> - - - Lorem ipsum dolor sit amet, consectetur adipiscing elit. - - - - - - - Lorem ipsum dolor sit amet, consectetur adipiscing elit. - - ; + } + /> - // "http://material-ui.com/#/components/date-picker" + } + /> + +
+ ); + + // "http://www.material-ui.com/#/components/raised-button" + const RaisedButtonExampleSimple = () => ( +
+ + + + +
+ ); + const RaisedButtonExampleComplex = () => ( +
+ + + + } + style={styles.button} + /> + } + /> +
+ ); + + // "http://www.material-ui.com/#/components/floating-action-button" + const FloatingActionButtonExampleSimple = () => ( +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ ); + + // "http://www.material-ui.com/#/components/icon-button" + const IconButtonExampleSimple = () => ( +
+ + +
+ ); + const IconButtonExampleComplex = () => ( +
+ + + + + + + + + + home + +
+ ); + const IconButtonExampleTooltip = () => ( +
+ + + + + + +
+ ); + const IconButtonExampleTouch = () => ( +
+ + + + + + + + + + + + + + + + + + +
+ ); + //Method 1: muidocs-icon-github is defined in a style sheet. + element = ; + //Method 2: ActionGrade is a component created using mui.SvgIcon. + element = + + ; + //Method 3: Manually creating a mui.FontIcon component within IconButton + element = + + ; + //Method 4: Using Google material-icons + element = settings_system_daydream; + + + // "http://www.material-ui.com/#/components/card" + const CardExampleWithAvatar = () => ( + + + } + > + + + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Donec mattis pretium massa.Aliquam erat volutpat.Nulla facilisi. + Donec vulputate interdum sollicitudin.Nunc lacinia auctor quam sed pellentesque. + Aliquam dui mauris, mattis quis lacus id, pellentesque lobortis odio. + + + + + + + ); + const CardExampleWithoutAvatar = () => ( + + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Donec mattis pretium massa.Aliquam erat volutpat.Nulla facilisi. + Donec vulputate interdum sollicitudin.Nunc lacinia auctor quam sed pellentesque. + Aliquam dui mauris, mattis quis lacus id, pellentesque lobortis odio. + + + + + + + ); + + // "http://www.material-ui.com/#/components/date-picker" + const DatePickerExampleSimple = () => ( +
+ + + +
+ ); + const DatePickerExampleInline = () => ( +
+ + +
+ ); + element = ( +
+ +
+ ); element = ; element = ; element = ; - // "http://material-ui.com/#/components/time-picker" - element = - // "http://material-ui.com/#/components/dialog" let standardActions = [ { text: 'Cancel' }, @@ -244,279 +903,102 @@ class MaterialUiTests extends React.Component<{}, MaterialUiTestsState> implemen ; - - // "http://material-ui.com/#/components/dropdown-menu" - let menuItems = [ - { payload: '1', text: 'Never' }, - { payload: '2', text: 'Every Night' }, - { payload: '3', text: 'Weeknights' }, - { payload: '4', text: 'Weekends' }, - { payload: '5', text: 'Weekly' }, - ]; - element = ; - - // "http://material-ui.com/#/components/icons" - element = home; - - // "http://material-ui.com/#/components/icon-buttons" - //Method 1: muidocs-icon-github is defined in a style sheet. - element = ; - //Method 2: ActionGrade is a component created using mui.SvgIcon. - element = - - ; - //Method 3: Manually creating a mui.FontIcon component within IconButton - element = - - ; - //Method 4: Using Google material-icons - element = settings_system_daydream; - - // "http://material-ui.com/#/components/icon-menus" - element = }> - - + // "http://www.material-ui.com/#/components/divider" + const DividerExampleForm = () => ( + + + + + + + + + + + ); + const DividerExampleList = () => ( +
+ + + + + + + + + +
+ ); + const DividerExampleMenu = () => ( + - + + - ; - - // "http://material-ui.com/#/components/left-nav" + + ); - // "http://material-ui.com/#/components/lists" - - - // "http://material-ui.com/#/components/menus" - element = - - - - - ; - element = - - - - - - - - } /> - } /> - } /> - } /> - } /> - - - ; - - // "http://material-ui.com/#/components/paper" - - - // "http://material-ui.com/#/components/progress" - - - // "http://material-ui.com/#/components/refresh-indicator" - - - // "http://material-ui.com/#/components/sliders" - - - // "http://material-ui.com/#/components/switches" - element = ; - element = ; - element = } - unCheckedIcon={} - label="custom icon" />; - - element = - ; - ; - - ; - - element = ; - - element = ; - - element = ; - - // "http://material-ui.com/#/components/snackbar" - - - // "http://material-ui.com/#/components/table" - - - // "http://material-ui.com/#/components/tabs" - - - // "http://material-ui.com/#/components/text-fields" - element = ; - element = ; - element = ; - element = ; - element = ('valueLinkValue') } />; - element = ; - element = ; - element = ; - element = ; - element = ; - element = ; - element = ; - - //Select Fields - let arbitraryArrayMenuItems = [ + // "http://www.material-ui.com/#/components/grid-list" + const tilesData = [ { - id: 0, - name: "zero", - }, - ]; - element = ; - element = ; - element = ; - element = ; - - //Floating Hint Text Labels - element = ; - element = ; - element = ; - element = ('floatingValueLinkValue') } />; - element = ; - element = ; - element = ; - element = ; - element = ; - element = ; - - - // "http://material-ui.com/#/components/time-picker" + img: 'images/grid-list/00-52-29-429_640.jpg', + title: 'Breakfast', + author: 'jill111', + featured: false, + }]; + const GridListExampleSimple = () => ( +
+ + {tilesData.map(tile => ( + by {tile.author}} + actionIcon={} + > + + + )) } + +
+ ); + const GridListExampleComplex = () => ( +
+ + {tilesData.map(tile => ( + } + actionPosition="left" + titlePosition="top" + titleBackground="linear-gradient(to bottom, rgba(0,0,0,0.7) 0%,rgba(0,0,0,0.3) 70%,rgba(0,0,0,0) 100%)" + cols={tile.featured ? 2 : 1} + rows={tile.featured ? 2 : 1} + > + + + )) } + +
+ ); - // "http://material-ui.com/#/components/toolbars" - - // "http://material-ui.com/#/components/grid-list" element = ; - + element = GridTile} @@ -529,6 +1011,1292 @@ class MaterialUiTests extends React.Component<{}, MaterialUiTestsState> implemen

Children are Required!

; + + // "http://www.material-ui.com/#/components/font-icon" + const FontIconExampleSimple = () => ( +
+ + + + + +
+ ); + + const FontIconExampleIcons = () => ( +
+ home + flight_takeoff + cloud_download + videogame_asset +
+ ); + + + // "http://www.material-ui.com/#/components/svg-icon" + const HomeIcon = (props) => ( + + + + ); + + const SvgIconExampleSimple = () => ( +
+ + + +
+ ); + const SvgIconExampleIcons = () => ( +
+ + + + +
+ ); + element = ; + element = ; + element = home; + + + // "http://www.material-ui.com/#/components/left-nav" + element = ( +
+ + + Menu Item + Menu Item 2 + +
+ ); + element = ( +
+ + this.setState(Object.assign({}, this.state, { open })) } + > + Menu Item + Menu Item 2 + +
+ ); + element = ( +
+ + + + +
+ ); + + + // "http://material-ui.com/#/components/lists" + const ListExampleSimple = () => ( +
+ + } /> + } /> + } /> + } /> + } /> + + + + } /> + } /> + } /> + } /> + +
+ ); + const ListExampleChat = () => ( +
+ + } + rightIcon={} + /> + } + rightIcon={} + /> + } + rightIcon={} + /> + } + rightIcon={} + /> + } + rightIcon={} + /> + + + + } + /> + } + /> + +
+ ); + const ListExampleNested = () => ( +
+ + } /> + } /> + } + initiallyOpen={true} + primaryTogglesNestedList={true} + nestedItems={[ + } + />, + } + disabled={true} + nestedItems={[ + } />, + ]} + />, + ]} + /> + +
+ ); + const iconButtonElement = ( + + + + ); + const rightIconMenu = ( + + Reply + Forward + Delete + + ); + const ListExampleMessages = () => ( +
+ + } + rightIconButton={rightIconMenu} + primaryText="Brendan Lim" + secondaryText={ +

+ Brunch this weekend?
+ I' ll be in your neighborhood doing errands this weekend.Do you want to grab brunch? +

+ } + secondaryTextLines={2} + /> +
+
+ ); + const ListExampleSelectable = () => ( +
+ + } + nestedItems={[ + } + />, + ]} + /> + } + /> + } + /> + } + /> + +
+ ); + + + // "http://www.material-ui.com/#/components/menu" + const MenuExampleSimple = () => ( +
+ + + + + + + + + + + + +
+ ); + const MenuExampleDisable = () => ( +
+ + + + + + + + + + + + + + + + +
+ ); + const MenuExampleIcons = () => ( +
+ + } /> + } /> + } /> + + } /> + } /> + + } /> + + + + } /> + settings}/> + settings + } + /> + ¶} /> + §} /> + +
+ ); + const MenuExampleSecondary = () => ( +
+ + + + + + + + + } /> + } /> + } /> + } /> + } /> + + + + + + + + + + + + + +
+ ); + const MenuExampleNested = () => ( +
+ + + + + } + menuItems={[ + } + menuItems={[ + , + , + , + , + ]} + />, + , + , + , + ]} + /> + + + + + + +
+ ); + + + // "http://www.material-ui.com/#/components/icon-menu" + const IconMenuExampleSimple = () => ( +
+ } + anchorOrigin={{ horizontal: 'left', vertical: 'top' }} + targetOrigin={{ horizontal: 'left', vertical: 'top' }} + > + + + + + + + } + anchorOrigin={{ horizontal: 'left', vertical: 'bottom' }} + targetOrigin={{ horizontal: 'left', vertical: 'bottom' }} + > + + + + + + + } + anchorOrigin={{ horizontal: 'right', vertical: 'bottom' }} + targetOrigin={{ horizontal: 'right', vertical: 'bottom' }} + > + + + + + + + } + anchorOrigin={{ horizontal: 'right', vertical: 'top' }} + targetOrigin={{ horizontal: 'right', vertical: 'top' }} + > + + + + + + +
+ ); + element = ( +
+ } + onChange={this.handleChangeSingle} + value={this.state.valueSingle} + > + + + + + + + } + onChange={this.handleChangeMultiple} + value={this.state.valueMultiple} + multiple={true} + > + + + + + + + +
+ ); + const IconMenuExampleScrollable = () => ( +
} + anchorOrigin={{ horizontal: 'left', vertical: 'top' }} + targetOrigin={{ horizontal: 'left', vertical: 'top' }} + maxHeight={272} + > + + + + ); + + + // "http://www.material-ui.com/#/components/dropdown-menu" + element = + + + + + + ; + const menuItems = []; + element = ( + + {menuItems} + + ); + element = ( + + + + + + + ); + + // "http://material-ui.com/#/components/paper" + const PaperExampleSimple = () => ( +
+ + + + + +
+ ); + const PaperExampleRounded = () => ( +
+ + + + + +
+ ); + const PaperExampleCircle = () => ( +
+ + + + + +
+ ); + + + // "http://www.material-ui.com/#/components/popover" + element = ( +
+ + +
+ +
+
+
+ ); + element = ( +
+ + +
+ +
+
+
+ ); + + + // "http://www.material-ui.com/#/components/circular-progress" + const CircularProgressExampleSimple = () => ( +
+ + + +
+ ); + element = ( +
+ + + +
+ ); + + + // "http://www.material-ui.com/#/components/linear-progress" + const LinearProgressExampleSimple = () => ( + + ); + element = ( + + ); + + + // "http://www.material-ui.com/#/components/refresh-indicator" + const RefreshIndicatorExampleSimple = () => ( +
+ + + + +
+ ); + const RefreshIndicatorExampleLoading = () => ( +
+ + +
+ ); + + + // "http://www.material-ui.com/#/components/select-field" + element = ( +
+ + + + + + + +
+ + + + +
+ ); + element = ( + + {menuItems} + + ); + element = ( + + + + + + + ); + element = ( +
+ + {menuItems} + +
+ + {menuItems} + +
+ ); + const {value} = this.state; + const night = value === 2 || value === 3; + element = ( +
+ + {menuItems} + +
+ + {menuItems} + +
+ ); + + + // "http://www.material-ui.com/#/components/slider" + const SliderExampleSimple = () => ( +
+ + + +
+ ); + const SliderExampleDisabled = () => ( +
+ + + +
+ ); + const SliderExampleStep = () => ( + + ); + + + // "http://www.material-ui.com/#/components/checkbox" + const CheckboxExampleSimple = () => ( +
+ + + + } + unCheckedIcon={} + label="Custom icon" + style={styles.checkbox} + /> + +
+ ); + + + // "http://www.material-ui.com/#/components/radio-button" + const RadioButtonExampleSimple = () => ( +
+ + + + + + + + + +
+ ); + + + // "http://www.material-ui.com/#/components/toggle" + const ToggleExampleSimple = () => ( +
+ + + + +
+ ); + + + // "http://material-ui.com/#/components/snackbar" + element = ( +
+ + +
+ ); + element = ( +
+ +
+ + +
+ ); + + // "http://www.material-ui.com/#/components/table" + element = ( +
+ + + ID + Name + Status + + + + + 1 + John Smith + Employed + + + 2 + Randal White + Unemployed + + + 3 + Stephanie Sanders + Employed + + + 4 + Steve Brown + Employed + + +
+ ); + const tableData = [ + { + name: 'John Smith', + status: 'Employed', + selected: true, + }, + ]; + element = ( +

+ + + + + Super Header + + + + ID + Name + Status + + + + {tableData.map( (row, index) => ( + + {index} + {row.name} + {row.status} + + ))} + + + + ID + Name + Status + + + + Super Footer + + + +
+ +
+

Table Properties

+ + + + + + +

TableBody Properties

+ + + +
+
+ ); + + // "http://www.material-ui.com/#/components/tabs" + const TabsExampleSimple = () => ( + + +
+

Tab One

+

+ This is an example tab. +

+

+ You can put any sort of HTML or react component in here. It even keeps the component state! +

+ +
+
+ +
+

Tab Two

+

+ This is another example tab. +

+
+
+ +
+

Tab Three

+

+ This is a third example tab. +

+
+
+
+ ); + element = ( + + +
+

Controllable Tab A

+

+ Tabs are also controllable if you want to programmatically pass them their values. + This allows for more functionality in Tabs such as not + having any Tab selected or assigning them different values. +

+
+
+ +
+

Controllable Tab B

+

+ This is another example of a controllable tab. Remember, if you + use controllable Tabs, you need to give all of your tabs values or else + you wont be able to select them. +

+
+
+
+ ); + const TabsExampleIcon = () => ( + + } /> + } /> + favorite} /> + + ); + + // "http://www.material-ui.com/#/components/text-field" + const TextFieldExampleSimple = () => ( +
+
+
+
+
+
+
+
+ +
+ ); + const TextFieldExampleError = () => ( +
+
+
+
+
+
+ ); + const TextFieldExampleCustomize = () => ( +
+
+
+
+ +
+ ); + const TextFieldExampleDisabled = () => ( +
+
+
+
+ +
+ ); + element = ; + + + // "http://www.material-ui.com/#/components/time-picker" + const TimePickerExampleSimple = () => ( +
+ + +
+ ); + element = ( +
+ this.picker12hr = t} + format="ampm" + hintText="12hr Format" + onChange={this.handleChangeTimePicker12} + /> + this.picker24hr = t} + format="24hr" + hintText="24hr Format" + onChange={this.handleChangeTimePicker24} + /> +
+ ); + + // "http://www.material-ui.com/#/components/toolbar" + const ToolbarExamplesSimple = () => ( + + + + + + + + + + + + + + + + + + + } + > + + + + + + + + ); + return element; } } diff --git a/material-ui/material-ui-tests.tsx.tscparams b/material-ui/material-ui-tests.tsx.tscparams new file mode 100644 index 000000000..855355b85 --- /dev/null +++ b/material-ui/material-ui-tests.tsx.tscparams @@ -0,0 +1 @@ +--experimentalDecorators \ No newline at end of file diff --git a/material-ui/material-ui.d.ts b/material-ui/material-ui.d.ts index 09d43bb86..d9f3a08d7 100644 --- a/material-ui/material-ui.d.ts +++ b/material-ui/material-ui.d.ts @@ -1,4 +1,4 @@ -// Type definitions for material-ui v0.13.4 +// Type definitions for material-ui v0.14.4 // Project: https://github.com/callemall/material-ui // Definitions by: Nathan Brown , Oliver Herrmann // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -8,6 +8,7 @@ declare module "material-ui" { export import AppBar = __MaterialUI.AppBar; // require('material-ui/lib/app-bar'); export import AppCanvas = __MaterialUI.AppCanvas; // require('material-ui/lib/app-canvas'); + export import AutoComplete = __MaterialUI.AutoComplete; // require('material-ui/lib/auto-complete'); export import Avatar = __MaterialUI.Avatar; // require('material-ui/lib/avatar'); export import Badge = __MaterialUI.Badge; // require('material-ui/lib/badge'); export import BeforeAfterWrapper = __MaterialUI.BeforeAfterWrapper; // require('material-ui/lib/before-after-wrapper'); @@ -24,12 +25,13 @@ declare module "material-ui" { export import DatePicker = __MaterialUI.DatePicker.DatePicker; // require('material-ui/lib/date-picker/date-picker'); export import DatePickerDialog = __MaterialUI.DatePicker.DatePickerDialog; // require('material-ui/lib/date-picker/date-picker-dialog'); export import Dialog = __MaterialUI.Dialog // require('material-ui/lib/dialog'); - export import DropDownIcon = __MaterialUI.DropDownIcon; // require('material-ui/lib/drop-down-icon'); - export import DropDownMenu = __MaterialUI.DropDownMenu; // require('material-ui/lib/drop-down-menu'); + export import DropDownMenu = __MaterialUI.Menus.DropDownMenu; // require('material-ui/lib/DropDownMenu/DropDownMenu'); export import EnhancedButton = __MaterialUI.EnhancedButton; // require('material-ui/lib/enhanced-button'); export import FlatButton = __MaterialUI.FlatButton; // require('material-ui/lib/flat-button'); export import FloatingActionButton = __MaterialUI.FloatingActionButton; // require('material-ui/lib/floating-action-button'); export import FontIcon = __MaterialUI.FontIcon; // require('material-ui/lib/font-icon'); + export import GridList = __MaterialUI.GridList.GridList; // require('material-ui/lib/gridlist/grid-list'); + export import GridTile = __MaterialUI.GridList.GridTile; // require('material-ui/lib/gridlist/grid-tile'); export import IconButton = __MaterialUI.IconButton; // require('material-ui/lib/icon-button'); export import IconMenu = __MaterialUI.Menus.IconMenu; // require('material-ui/lib/menus/icon-menu'); export import LeftNav = __MaterialUI.LeftNav; // require('material-ui/lib/left-nav'); @@ -37,21 +39,22 @@ declare module "material-ui" { export import List = __MaterialUI.Lists.List; // require('material-ui/lib/lists/list'); export import ListDivider = __MaterialUI.Lists.ListDivider; // require('material-ui/lib/lists/list-divider'); export import ListItem = __MaterialUI.Lists.ListItem; // require('material-ui/lib/lists/list-item'); - export import Menu = __MaterialUI.Menu.Menu; // require('material-ui/lib/menu/menu'); - export import MenuItem = __MaterialUI.Menu.MenuItem; // require('material-ui/lib/menu/menu-item'); - export import Mixins = __MaterialUI.Mixins; // require('material-ui/lib/mixins/'); + export import Menu = __MaterialUI.Menus.Menu; // require('material-ui/lib/menus/menu'); + export import MenuItem = __MaterialUI.Menus.MenuItem; // require('material-ui/lib/menus/menu-item'); + export import Mixins = __MaterialUI.Mixins; // require('material-ui/lib/mixins'); export import Overlay = __MaterialUI.Overlay; // require('material-ui/lib/overlay'); export import Paper = __MaterialUI.Paper; // require('material-ui/lib/paper'); + export import Popover = __MaterialUI.Popover.Popover; // require('material-ui/lib/popover/popover'); export import RadioButton = __MaterialUI.RadioButton; // require('material-ui/lib/radio-button'); export import RadioButtonGroup = __MaterialUI.RadioButtonGroup; // require('material-ui/lib/radio-button-group'); export import RaisedButton = __MaterialUI.RaisedButton; // require('material-ui/lib/raised-button'); export import RefreshIndicator = __MaterialUI.RefreshIndicator; // require('material-ui/lib/refresh-indicator'); - export import Ripples = __MaterialUI.Ripples; // require('material-ui/lib/ripples/'); + export import Ripples = __MaterialUI.Ripples; // require('material-ui/lib/ripples'); export import SelectField = __MaterialUI.SelectField; // require('material-ui/lib/select-field'); + export import SelectableContainerEnhance = __MaterialUI.Hoc.SelectableContainerEnhance; // require('material-ui/lib/hoc/selectable-enhance'); export import Slider = __MaterialUI.Slider; // require('material-ui/lib/slider'); export import SvgIcon = __MaterialUI.SvgIcon; // require('material-ui/lib/svg-icon'); - export import Icons = __MaterialUI.Icons; - export import Styles = __MaterialUI.Styles; // require('material-ui/lib/styles/'); + export import Styles = __MaterialUI.Styles; // require('material-ui/lib/styles'); export import Snackbar = __MaterialUI.Snackbar; // require('material-ui/lib/snackbar'); export import Tab = __MaterialUI.Tabs.Tab; // require('material-ui/lib/tabs/tab'); export import Tabs = __MaterialUI.Tabs.Tabs; // require('material-ui/lib/tabs/tabs'); @@ -62,8 +65,8 @@ declare module "material-ui" { export import TableHeaderColumn = __MaterialUI.Table.TableHeaderColumn; // require('material-ui/lib/table/table-header-column'); export import TableRow = __MaterialUI.Table.TableRow; // require('material-ui/lib/table/table-row'); export import TableRowColumn = __MaterialUI.Table.TableRowColumn; // require('material-ui/lib/table/table-row-column'); - export import ThemeWrapper = __MaterialUI.ThemeWrapper; // require('material-ui/lib/theme-wrapper'); export import Toggle = __MaterialUI.Toggle; // require('material-ui/lib/toggle'); + export import ThemeWrapper = __MaterialUI.ThemeWrapper; // require('material-ui/lib/theme-wrapper'); export import TimePicker = __MaterialUI.TimePicker; // require('material-ui/lib/time-picker'); export import TextField = __MaterialUI.TextField; // require('material-ui/lib/text-field'); export import Toolbar = __MaterialUI.Toolbar.Toolbar; // require('material-ui/lib/toolbar/toolbar'); @@ -71,10 +74,18 @@ declare module "material-ui" { export import ToolbarSeparator = __MaterialUI.Toolbar.ToolbarSeparator; // require('material-ui/lib/toolbar/toolbar-separator'); export import ToolbarTitle = __MaterialUI.Toolbar.ToolbarTitle; // require('material-ui/lib/toolbar/toolbar-title'); export import Tooltip = __MaterialUI.Tooltip; // require('material-ui/lib/tooltip'); - export import Utils = __MaterialUI.Utils; // require('material-ui/lib/utils/'); - - export import GridList = __MaterialUI.GridList.GridList; // require('material-ui/lib/gridlist/grid-list'); - export import GridTile = __MaterialUI.GridList.GridTile; // require('material-ui/lib/gridlist/grid-tile'); + export import Utils = __MaterialUI.Utils; // require('material-ui/lib/utils'); + + // svg icons + import NavigationMenu = __MaterialUI.SvgIcon; // require('material-ui/lib/svg-icon/navigation/menu'); + import NavigationChevronLeft = __MaterialUI.SvgIcon; // require('material-ui/lib/svg-icon/navigation/chevron-left'); + import NavigationChevronRight = __MaterialUI.SvgIcon; // require('material-ui/lib/svg-icon/navigation/chevron-right'); + + export const Icons: { + NavigationMenu: NavigationMenu, + NavigationChevronLeft: NavigationChevronLeft, + NavigationChevronRight: NavigationChevronRight, + }; // export type definitions export type TouchTapEvent = __MaterialUI.TouchTapEvent; @@ -83,7 +94,7 @@ declare module "material-ui" { } declare namespace __MaterialUI { - import React = __React; + export import React = __React; // ReactLink is from "react/addons" interface ReactLink { @@ -103,756 +114,10 @@ declare namespace __MaterialUI { // What's common between React.TouchEventHandler and React.MouseEventHandler interface TouchTapEventHandler extends React.EventHandler { } - // more specific than React.HTMLAttributes - - interface AppBarProps extends React.Props { - iconClassNameLeft?: string; - iconClassNameRight?: string; - iconElementLeft?: React.ReactElement; - iconElementRight?: React.ReactElement; - iconStyleRight?: string; - style?: React.CSSProperties; - showMenuIconButton?: boolean; - title?: React.ReactNode; - zDepth?: number; - - onLeftIconButtonTouchTap?: TouchTapEventHandler; - onRightIconButtonTouchTap?: TouchTapEventHandler; + interface ThemeWrapperProps extends React.Props { + theme: Styles.MuiTheme; } - export class AppBar extends React.Component{ - } - - interface AppCanvasProps extends React.Props { - style?: React.CSSProperties; - } - export class AppCanvas extends React.Component { - } - - interface AvatarProps extends React.Props { - icon?: React.ReactElement; - backgroundColor?: string; - color?: string; - size?: number; - src?: string; - style?: React.CSSProperties; - } - export class Avatar extends React.Component { - } - - interface BadgeProps extends React.Props { - badgeContent: React.ReactElement | string | number; - primary?: boolean; - secondary?: boolean; - style?: React.CSSProperties; - badgeStyle?: React.CSSProperties; - } - export class Badge extends React.Component { - } - - interface BeforeAfterWrapperProps extends React.Props { - beforeStyle?: React.CSSProperties; - afterStyle?: React.CSSProperties; - beforeElementType?: string; - afterElementType?: string; - elementType?: string; - } - export class BeforeAfterWrapper extends React.Component { - } - - namespace Card { - - interface CardProps extends React.Props { - expandable?: boolean; - initiallyExpanded?: boolean; - onExpandedChange?: (isExpanded: boolean) => void; - style?: React.CSSProperties; - } - export class Card extends React.Component { - } - - interface CardActionsProps extends React.Props { - expandable?: boolean; - showExpandableButton?: boolean; - style?: React.CSSProperties; - } - export class CardActions extends React.Component { - } - - interface CardExpandableProps extends React.Props { - onExpanding?: (isExpanded: boolean) => void; - expanded?: boolean; - style?: React.CSSProperties; - } - export class CardExpandable extends React.Component { - } - - interface CardHeaderProps extends React.Props { - expandable?: boolean; - showExpandableButton?: boolean; - title?: string | React.ReactElement; - titleColor?: string; - titleStyle?: React.CSSProperties; - subtitle?: string | React.ReactElement; - subtitleColor?: string; - subtitleStyle?: React.CSSProperties; - textStyle?: React.CSSProperties; - style?: React.CSSProperties; - avatar: React.ReactElement | string; - } - export class CardHeader extends React.Component { - } - - interface CardMediaProps extends React.Props { - expandable?: boolean; - overlay?: React.ReactNode; - overlayStyle?: React.CSSProperties; - overlayContainerStyle?: React.CSSProperties; - overlayContentStyle?: React.CSSProperties; - mediaStyle?: React.CSSProperties; - style?: React.CSSProperties; - } - export class CardMedia extends React.Component { - } - - interface CardTextProps extends React.Props { - expandable?: boolean; - color?: string; - style?: React.CSSProperties; - } - export class CardText extends React.Component { - } - - interface CardTitleProps extends React.Props { - expandable?: boolean; - showExpandableButton?: boolean; - title?: string | React.ReactElement; - titleColor?: string; - titleStyle?: React.CSSProperties; - subtitle?: string | React.ReactElement; - subtitleColor?: string; - subtitleStyle?: React.CSSProperties; - textStyle?: React.CSSProperties; - style?: React.CSSProperties; - } - export class CardTitle extends React.Component { - } - } - - // what's not commonly overridden by Checkbox, RadioButton, or Toggle - interface CommonEnhancedSwitchProps extends React.HTMLAttributes, React.Props { - // is root element - id?: string; - iconStyle?: React.CSSProperties; - labelStyle?: React.CSSProperties; - rippleStyle?: React.CSSProperties; - thumbStyle?: React.CSSProperties; - trackStyle?: React.CSSProperties; - name?: string; - value?: string; - label?: string; - required?: boolean; - disabled?: boolean; - defaultSwitched?: boolean; - disableFocusRipple?: boolean; - disableTouchRipple?: boolean; - } - - interface EnhancedSwitchProps extends CommonEnhancedSwitchProps { - // is root element - inputType: string; - switchElement: React.ReactElement; - onParentShouldUpdate: (isInputChecked: boolean) => void; - switched: boolean; - rippleColor?: string; - onSwitch?: (e: React.MouseEvent, isInputChecked: boolean) => void; - labelPosition?: string; - } - export class EnhancedSwitch extends React.Component { - isSwitched(): boolean; - setSwitched(newSwitchedValue: boolean): void; - getValue(): any; - isKeyboardFocused(): boolean; - } - - interface CheckboxProps extends CommonEnhancedSwitchProps { - // is root element - checkedIcon?: React.ReactElement<{ style?: React.CSSProperties }>; // Normally an SvgIcon - defaultChecked?: boolean; - iconStyle?: React.CSSProperties; - label?: string; - labelStyle?: React.CSSProperties; - labelPosition?: string; - style?: React.CSSProperties; - checked?: boolean; - unCheckedIcon?: React.ReactElement<{ style?: React.CSSProperties }>; // Normally an SvgIcon - - disabled?: boolean; - valueLink?: ReactLink; - checkedLink?: ReactLink; - - onCheck?: (event: React.MouseEvent, checked: boolean) => void; - } - export class Checkbox extends React.Component { - isChecked(): void; - setChecked(newCheckedValue: boolean): void; - } - - interface CircularProgressProps extends React.Props { - mode?: string; - value?: number; - min?: number; - max?: number; - size?: number; - color?: string; - innerStyle?: React.CSSProperties; - style?: React.CSSProperties; - - } - export class CircularProgress extends React.Component { - } - - interface ClearFixProps extends React.Props { - } - export class ClearFix extends React.Component { - } - - namespace DatePicker { - interface DatePickerProps extends React.Props { - autoOk?: boolean; - defaultDate?: Date; - formatDate?: (date:Date) => string; - hintText?: string; - floatingLabelText?: string; - hideToolbarYearChange?: boolean; - maxDate?: Date; - minDate?: Date; - mode?: string; - onDismiss?: () => void; - - // e is always null - onChange?: (e: any, d: Date) => void; - - onFocus?: React.FocusEventHandler; - onShow?: () => void; - onTouchTap?: React.TouchEventHandler; - shouldDisableDate?: (day: Date) => boolean; - showYearSelector?: boolean; - style?: React.CSSProperties; - textFieldStyle?: React.CSSProperties; - } - export class DatePicker extends React.Component { - } - - interface DatePickerDialogProps extends React.Props { - disableYearSelection?: boolean; - initialDate?: Date; - maxDate?: Date; - minDate?: Date; - onAccept?: (d: Date) => void; - onClickAway?: () => void; - onDismiss?: () => void; - onShow?: () => void; - shouldDisableDate?: (day: Date) => boolean; - showYearSelector?: boolean; - } - export class DatePickerDialog extends React.Component { - } - } - - export interface DialogAction { - id?: string; - text: string; - ref?: string; - - onTouchTap?: TouchTapEventHandler; - onClick?: React.MouseEventHandler; - } - interface DialogProps extends React.Props { - actions?: Array>; - actionFocus?: string; - autoDetectWindowHeight?: boolean; - autoScrollBodyContent?: boolean; - style?: React.CSSProperties; - bodyStyle?: React.CSSProperties; - contentClassName?: string; - contentInnerStyle?: React.CSSProperties; - contentStyle?: React.CSSProperties; - modal?: boolean; - openImmediately?: boolean; - repositionOnUpdate?: boolean; - title?: React.ReactNode; - defaultOpen?: boolean; - open?: boolean; - - onClickAway?: () => void; - onDismiss?: () => void; - onShow?: () => void; - onRequestClose?: (buttonClicked: boolean) => void; - } - export class Dialog extends React.Component { - dismiss(): void; - show(): void; - isOpen(): boolean; - } - - interface DropDownIconProps extends React.Props { - menuItems: Menu.MenuItemRequest[]; - closeOnMenuItemTouchTap?: boolean; - iconStyle?: React.CSSProperties; - iconClassName?: string; - iconLigature?: string; - - onChange?: Menu.ItemTapEventHandler; - } - export class DropDownIcon extends React.Component { - } - - interface DropDownMenuProps extends React.Props { - displayMember?: string; - valueMember?: string; - autoWidth?: boolean; - menuItems: Menu.MenuItemRequest[]; - menuItemStyle?: React.CSSProperties; - selectedIndex?: number; - underlineStyle?: React.CSSProperties; - iconStyle?: React.CSSProperties; - labelStyle?: React.CSSProperties; - style?: React.CSSProperties; - disabled?: boolean; - valueLink?: ReactLink; - value?: number; - - onChange?: Menu.ItemTapEventHandler; - } - export class DropDownMenu extends React.Component { - } - - // non generally overridden elements of EnhancedButton - interface SharedEnhancedButtonProps extends React.HTMLAttributes, React.Props { - centerRipple?: boolean; - containerElement?: string | React.ReactElement; - disabled?: boolean; - disableFocusRipple?: boolean; - disableKeyboardFocus?: boolean; - disableTouchRipple?: boolean; - keyboardFocused?: boolean; - linkButton?: boolean; - focusRippleColor?: string; - focusRippleOpacity?: number; - touchRippleOpacity?: number; - tabIndex?: number; - - onBlur?: React.FocusEventHandler; - onFocus?: React.FocusEventHandler; - onKeyboardFocus?: (e: React.FocusEvent, isKeyboardFocused: boolean) => void; - onKeyDown?: React.KeyboardEventHandler; - onKeyUp?: React.KeyboardEventHandler; - onMouseEnter?: React.MouseEventHandler; - onMouseLeave?: React.MouseEventHandler; - onTouchStart?: React.TouchEventHandler; - onTouchEnd?: React.TouchEventHandler; - onTouchTap?: TouchTapEventHandler; - } - - interface EnhancedButtonProps extends SharedEnhancedButtonProps { - touchRippleColor?: string; - focusRippleColor?: string; - style?: React.CSSProperties; - } - export class EnhancedButton extends React.Component { - } - - interface FlatButtonProps extends SharedEnhancedButtonProps { - hoverColor?: string; - label?: string; - labelPosition?: string; - labelStyle?: React.CSSProperties; - linkButton?: boolean; - primary?: boolean; - secondary?: boolean; - rippleColor?: string; - style?: React.CSSProperties; - } - export class FlatButton extends React.Component { - } - - interface FloatingActionButtonProps extends SharedEnhancedButtonProps { - backgroundColor?: string; - disabled?: boolean; - disabledColor?: string; - iconClassName?: string; - iconStyle?: React.CSSProperties; - mini?: boolean; - secondary?: boolean; - style?: React.CSSProperties; - } - export class FloatingActionButton extends React.Component { - } - - interface FontIconProps extends React.Props { - color?: string; - hoverColor?: string; - onMouseLeave?: React.MouseEventHandler; - onMouseEnter?: React.MouseEventHandler; - style?: React.CSSProperties; - className?: string; - } - export class FontIcon extends React.Component { - } - - interface IconButtonProps extends SharedEnhancedButtonProps { - iconClassName?: string; - iconStyle?: React.CSSProperties; - style?: React.CSSProperties; - tooltip?: string; - tooltipPosition?: string; - tooltipStyles?: React.CSSProperties; - touch?: boolean; - - onBlur?: React.FocusEventHandler; - onFocus?: React.FocusEventHandler; - } - export class IconButton extends React.Component { - } - - interface LeftNavProps extends React.Props { - disableSwipeToOpen?: boolean; - docked?: boolean; - header?: React.ReactElement; - menuItems: Menu.MenuItemRequest[]; - onChange?: Menu.ItemTapEventHandler; - onNavOpen?: () => void; - onNavClose?: () => void; - openRight?: Boolean; - selectedIndex?: number; - menuItemClassName?: string; - menuItemClassNameSubheader?: string; - menuItemClassNameLink?: string; - style?: React.CSSProperties; - } - export class LeftNav extends React.Component { - } - - interface LinearProgressProps extends React.Props { - mode?: string; - value?: number; - min?: number; - max?: number; - } - export class LinearProgress extends React.Component { - } - - namespace Lists { - interface ListProps extends React.Props { - insetSubheader?: boolean; - subheader?: string; - subheaderStyle?: React.CSSProperties; - zDepth?: number; - style?: React.CSSProperties; - } - export class List extends React.Component { - } - - interface ListDividerProps extends React.Props { - inset?: boolean; - } - export class ListDivider extends React.Component { - } - - interface ListItemProps extends React.Props { - autoGenerateNestedIndicator?: boolean; - disableKeyboardFocus?: boolean; - initiallyOpen?: boolean; - innerDivStyle?: React.CSSProperties; - insetChildren?: boolean; - innerStyle?: React.CSSProperties; - leftAvatar?: React.ReactElement; - leftCheckbox?: React.ReactElement; - leftIcon?: React.ReactElement; - nestedLevel?: number; - nestedItems?: React.ReactElement[]; - onKeyboardFocus?: React.FocusEventHandler; - onNestedListToggle?: (item: ListItem) => void; - onClick?: React.MouseEventHandler; - rightAvatar?: React.ReactElement; - rightIcon?: React.ReactElement; - rightIconButton?: React.ReactElement; - rightToggle?: React.ReactElement; - primaryText?: React.ReactNode; - secondaryText?: React.ReactNode; - secondaryTextLines?: number; - style?: React.CSSProperties; - } - export class ListItem extends React.Component { - } - } - - // Old menu implementation. Being replaced by new "menus". - namespace Menu { - interface ItemTapEventHandler { - (e: TouchTapEvent, index: number, menuItem: MenuItemRequest): void; - } - - // almost extends MenuItemProps, but certain required items are generated in Menu and not passed here. - interface MenuItemRequest extends React.Props { - // use value from MenuItem.Types.* - type?: string; - - text?: string; - data?: string; - payload?: string; - icon?: React.ReactElement; - attribute?: string; - number?: string; - toggle?: boolean; - onTouchTap?: TouchTapEventHandler; - isDisabled?: boolean; - style?: React.CSSProperties; - - // for MenuItems.Types.NESTED - items?: MenuItemRequest[]; - - // for custom text or payloads - [propertyName: string]: any; - } - - interface MenuProps extends React.Props { - index: number; - text?: string; - menuItems: MenuItemRequest[]; - zDepth?: number; - active?: boolean; - onItemTap?: ItemTapEventHandler; - menuItemStyle?: React.CSSProperties; - style?: React.CSSProperties; - } - export class Menu extends React.Component { - } - - interface MenuItemProps extends React.Props { - index: number; - icon?: React.ReactElement; - iconClassName?: string; - iconRightClassName?: string; - iconStyle?: React.CSSProperties; - iconRightStyle?: React.CSSProperties; - attribute?: string; - number?: string; - data?: string; - toggle?: boolean; - onTouchTap?: (e: React.MouseEvent, key: number) => void; - onToggle?: (e: React.MouseEvent, key: number, toggled: boolean) => void; - selected?: boolean; - active?: boolean; - style?: React.CSSProperties; - } - export class MenuItem extends React.Component { - static Types: { LINK: string, SUBHEADER: string, NESTED: string, } - } - } - - export namespace Mixins { - interface ClickAwayable extends React.Mixin { - } - var ClickAwayable: ClickAwayable; - - interface WindowListenable extends React.Mixin { - } - var WindowListenable: WindowListenable; - - interface StylePropable extends React.Mixin { - } - var StylePropable: StylePropable - - interface StyleResizable extends React.Mixin { - } - var StyleResizable: StyleResizable - } - - interface OverlayProps extends React.Props { - autoLockScrolling?: boolean; - show?: boolean; - transitionEnabled?: boolean; - } - export class Overlay extends React.Component { - } - - interface PaperProps extends React.HTMLAttributes, React.Props { - circle?: boolean; - rounded?: boolean; - transitionEnabled?: boolean; - zDepth?: number; - } - export class Paper extends React.Component { - } - - interface RadioButtonProps extends CommonEnhancedSwitchProps { - // is root element - defaultChecked?: boolean; - iconStyle?: React.CSSProperties; - label?: string; - labelStyle?: React.CSSProperties; - labelPosition?: string; - style?: React.CSSProperties; - value?: string; - - onCheck?: (e: React.FormEvent, selected: string) => void; - } - export class RadioButton extends React.Component { - } - - interface RadioButtonGroupProps extends React.Props { - defaultSelected?: string; - labelPosition?: string; - name: string; - style?: React.CSSProperties; - valueSelected?: string; - - onChange?: (e: React.FormEvent, selected: string) => void; - } - export class RadioButtonGroup extends React.Component { - getSelectedValue(): string; - setSelectedValue(newSelectionValue: string): void; - clearValue(): void; - } - - interface RaisedButtonProps extends SharedEnhancedButtonProps { - className?: string; - disabled?: boolean; - label?: string; - primary?: boolean; - secondary?: boolean; - labelStyle?: React.CSSProperties; - backgroundColor?: string; - labelColor?: string; - disabledBackgroundColor?: string; - disabledLabelColor?: string; - fullWidth?: boolean; - } - export class RaisedButton extends React.Component { - } - - interface RefreshIndicatorProps extends React.Props { - left: number; - percentage?: number; - size?: number; - status?: string; - top: number; - style?: React.CSSProperties; - } - export class RefreshIndicator extends React.Component { - } - - namespace Ripples { - interface CircleRippleProps extends React.Props { - color?: string; - opacity?: number; - style?: React.CSSProperties; - } - export class CircleRipple extends React.Component { - } - - interface FocusRippleProps extends React.Props { - color?: string; - style?: React.CSSProperties; - innerStyle?: React.CSSProperties; - opacity?: number; - show?: boolean; - } - export class FocusRipple extends React.Component { - } - - interface TouchRippleProps extends React.Props { - centerRipple?: boolean; - color?: string; - opacity?: number; - style?: React.CSSProperties; - } - export class TouchRipple extends React.Component { - } - } - - interface SelectFieldProps extends React.Props { - // passed to TextField - errorStyle?: React.CSSProperties; - errorText?: string; - floatingLabelText?: string; - floatingLabelStyle?: React.CSSProperties; - fullWidth?: boolean; - hintText?: string | React.ReactElement; - - // passed to DropDownMenu - displayMember?: string; - valueMember?: string; - autoWidth?: boolean; - menuItems: Menu.MenuItemRequest[]; - menuItemStyle?: React.CSSProperties; - selectedIndex?: number; - underlineStyle?: React.CSSProperties; - underlineFocusStyle?: React.CSSProperties; - iconStyle?: React.CSSProperties; - labelStyle?: React.CSSProperties; - style?: React.CSSProperties; - disabled?: boolean; - valueLink?: ReactLink; - value?: number; - - onChange?: Menu.ItemTapEventHandler; - onEnterKeyDown?: React.KeyboardEventHandler; - - // own properties - selectFieldRoot?: string; - multiLine?: boolean; - type?: string; - rows?: number; - inputStyle?: React.CSSProperties; - } - export class SelectField extends React.Component { - } - - interface SliderProps extends React.Props { - name: string; - defaultValue?: number; - description?: string; - error?: string; - max?: number; - min?: number; - required?: boolean; - step?: number; - value?: number; - style?: React.CSSProperties; - } - export class Slider extends React.Component { - } - - interface SvgIconProps extends React.Props { - color?: string; - hoverColor?: string; - viewBox?: string; - style?: React.CSSProperties; - } - export class SvgIcon extends React.Component { - } - - export namespace Icons { - export import NavigationMenu = __MaterialUI.NavigationMenu; - export import NavigationChevronLeft = __MaterialUI.NavigationChevronLeft; - export import NavigationChevronRight = __MaterialUI.NavigationChevronRight; - } - - interface NavigationMenuProps extends React.Props { - } - export class NavigationMenu extends React.Component { - } - - interface NavigationChevronLeftProps extends React.Props { - } - export class NavigationChevronLeft extends React.Component { - } - - interface NavigationChevronRightProps extends React.Props { - } - export class NavigationChevronRight extends React.Component { + export class ThemeWrapper extends React.Component { } export namespace Styles { @@ -888,26 +153,43 @@ declare namespace __MaterialUI { accent2Color?: string; accent3Color?: string; textColor?: string; + alternateTextColor?: string; canvasColor?: string; borderColor?: string; disabledColor?: string; - alternateTextColor?: string; + pickerHeaderColor?: string; + clockCircleColor?: string; + shadowColor?: string; } interface MuiTheme { - rawTheme: RawTheme; - static: boolean; + isRtl?: boolean; + userAgent?: any; + zIndex?: zIndex; + baseTheme?: RawTheme; + rawTheme?: RawTheme; appBar?: { color?: string, textColor?: string, - height?: number - }, + height?: number, + }; avatar?: { - borderColor?: string; + borderColor?: string, } + badge?: { + color?: string, + textColor?: string, + primaryColor?: string, + primaryTextColor?: string, + secondaryColor?: string, + secondaryTextColor?: string, + }, button?: { height?: number, minWidth?: number, - iconButtonSize?: number + iconButtonSize?: number, + }, + cardText?: { + textColor?: string, }, checkbox?: { boxColor?: string, @@ -915,7 +197,7 @@ declare namespace __MaterialUI { requiredColor?: string, disabledColor?: string, labelColor?: string, - labelDisabledColor?: string + labelDisabledColor?: string, }, datePicker?: { color?: string, @@ -929,10 +211,11 @@ declare namespace __MaterialUI { }, flatButton?: { color?: string, + buttonFilterColor?: string, + disabledColor?: string, textColor?: string, primaryTextColor?: string, secondaryTextColor?: string, - disabledColor?: string }, floatingActionButton?: { buttonSize?: number, @@ -942,17 +225,20 @@ declare namespace __MaterialUI { secondaryColor?: string, secondaryIconColor?: string, disabledColor?: string, - disabledTextColor?: string + disabledTextColor?: string, + }, + gridTile?: { + textColor?: string, }, inkBar?: { - backgroundColor?: string; + backgroundColor?: string, }, leftNav?: { width?: number, color?: string, }, listItem?: { - nestedLevelDepth?: number; + nestedLevelDepth?: number, }, menu?: { backgroundColor?: string, @@ -972,6 +258,7 @@ declare namespace __MaterialUI { }, paper?: { backgroundColor?: string, + zDepthShadows?: string[], }, radioButton?: { borderColor?: string, @@ -981,7 +268,7 @@ declare namespace __MaterialUI { disabledColor?: string, size?: number, labelColor?: string, - labelDisabledColor?: string + labelDisabledColor?: string, }, raisedButton?: { color?: string, @@ -991,19 +278,19 @@ declare namespace __MaterialUI { secondaryColor?: string, secondaryTextColor?: string, disabledColor?: string, - disabledTextColor?: string + disabledTextColor?: string, }, refreshIndicator?: { - strokeColor?: string; - loadingStrokeColor?: string; + strokeColor?: string, + loadingStrokeColor?: string, }; slider?: { trackSize?: number, trackColor?: string, trackColorSelected?: string, handleSize?: number, - handleSizeActive?: number, handleSizeDisabled?: number, + handleSizeActive?: number, handleColorZero?: string, handleFillColor?: string, selectionColor?: string, @@ -1022,6 +309,8 @@ declare namespace __MaterialUI { }; tableHeaderColumn?: { textColor?: string; + height?: number; + spacing?: number; }; tableFooter?: { borderColor?: string; @@ -1033,6 +322,7 @@ declare namespace __MaterialUI { selectedColor?: string; textColor?: string; borderColor?: string; + height?: number; }; tableRowColumn?: { height?: number; @@ -1043,6 +333,8 @@ declare namespace __MaterialUI { textColor?: string; accentColor?: string; clockColor?: string; + clockCircleColor?: string; + headerColor?: string; selectColor?: string; selectTextColor?: string; }; @@ -1054,9 +346,9 @@ declare namespace __MaterialUI { trackOnColor?: string, trackOffColor?: string, trackDisabledColor?: string, - trackRequiredColor?: string, labelColor?: string, labelDisabledColor?: string + trackRequiredColor?: string, }, toolbar?: { backgroundColor?: string, @@ -1067,7 +359,9 @@ declare namespace __MaterialUI { menuHoverColor?: string, }; tabs?: { - backgroundColor?: string; + backgroundColor?: string, + textColor?: string, + selectedTextColor?: string, }; textField?: { textColor?: string; @@ -1079,19 +373,37 @@ declare namespace __MaterialUI { backgroundColor?: string; borderColor?: string; }; - isRtl: boolean; } + interface zIndex { + menu: number; + appBar: number; + leftNavOverlay: number; + leftNav: number; + dialogOverlay: number; + dialog: number; + layer: number; + popover: number; + snackbar: number; + tooltip: number; + } + export var zIndex: zIndex; + interface RawTheme { - spacing: Spacing; + spacing?: Spacing; fontFamily?: string; - palette: ThemePalette; + palette?: ThemePalette; + zIndex?: zIndex; } + var lightBaseTheme: RawTheme; + var darkBaseTheme: RawTheme; - export function ThemeDecorator(muiTheme: Styles.MuiTheme):

(Component: React.ComponentClass

) => React.ComponentClass

; + export function ThemeDecorator(muiTheme: Styles.MuiTheme): (Component: TFunction) => TFunction; + + export function getMuiTheme(baseTheme: RawTheme, muiTheme ?: MuiTheme): MuiTheme; interface ThemeManager { - getMuiTheme(rawTheme: RawTheme): MuiTheme; + getMuiTheme(baseTheme: RawTheme, muiTheme?: MuiTheme): MuiTheme; modifyRawThemeSpacing(muiTheme: MuiTheme, newSpacing: Spacing): MuiTheme; modifyRawThemePalette(muiTheme: MuiTheme, newPaletteKeys: ThemePalette): MuiTheme; modifyRawThemeFontFamily(muiTheme: MuiTheme, newFontFamily: string): MuiTheme; @@ -1128,56 +440,1024 @@ declare namespace __MaterialUI { export var LightRawTheme: RawTheme; } - interface SnackbarProps extends React.Props { - message: string; - action?: string; - autoHideDuration?: number; - onActionTouchTap?: React.TouchEventHandler; - onShow?: () => void; - onDismiss?: () => void; - openOnMount?: boolean; + interface AppBarProps extends React.Props { + className?: string; + iconClassNameLeft?: string; + iconClassNameRight?: string; + iconElementLeft?: React.ReactElement; + iconElementRight?: React.ReactElement; + iconStyleRight?: string; + onLeftIconButtonTouchTap?: TouchTapEventHandler; + onRightIconButtonTouchTap?: TouchTapEventHandler; + onTitleTouchTap?: TouchTapEventHandler; + showMenuIconButton?: boolean; + style?: React.CSSProperties; + title?: React.ReactNode; + titleStyle?: React.CSSProperties; + zDepth?: number; + } + export class AppBar extends React.Component{ + } + + interface AppCanvasProps extends React.Props { + } + export class AppCanvas extends React.Component { + } + + interface Origin { + horizontal: string; // oneOf(['left', 'middle', 'right']) + vertical: string; // oneOf(['top', 'center', 'bottom']) + } + + type AutoCompleteDataItem = { text: string, value: React.ReactNode } | string; + type AutoCompleteDataSource = { text: string, value: React.ReactNode }[] | string[]; + interface AutoCompleteProps extends React.Props { + anchorOrigin?: Origin; + animated?: boolean; + dataSource?: AutoCompleteDataSource; + disableFocusRipple?: boolean; + errorStyle?: React.CSSProperties; + errorText?: string; + filter?: (searchText: string, key: string, item: AutoCompleteDataItem) => boolean; + floatingLabelText?: string; + fullWidth?: boolean; + hintText?: string; + listStyle?: React.CSSProperties; + menuCloseDelay?: number; + menuProps?: any; + menuStyle?: React.CSSProperties; + onNewRequest?: (chosenRequest: string, index: number) => void; + onUpdateInput?: (searchText: string, dataSource: AutoCompleteDataSource) => void; + open?: boolean; + searchText?: string; + /** @deprecated use noFilter instead */ + showAllItems?: boolean; + style?: React.CSSProperties; + targetOrigin?: Origin; + touchTapCloseDelay?: number; + triggerUpdateOnFocus?: boolean; + /** @deprecated updateWhenFocused has been renamed to triggerUpdateOnFocus */ + updateWhenFocused?: boolean; + } + export class AutoComplete extends React.Component { + static noFilter: () => boolean; + static defaultFilter: (searchText: string, key: string) => boolean; + static caseSensitiveFilter: (searchText: string, key: string) => boolean; + static caseInsensitiveFilter: (searchText: string, key: string) => boolean; + static levenshteinDistanceFilter(distanceLessThan: number): (searchText: string, key: string) => boolean; + static fuzzyFilter: (searchText: string, key: string) => boolean; + static Item: Menus.MenuItem; + static Divider: Divider; + } + + interface AvatarProps extends React.Props { + backgroundColor?: string; + className?: string; + color?: string; + icon?: React.ReactElement; + size?: number; + src?: string; style?: React.CSSProperties; } - export class Snackbar extends React.Component { + export class Avatar extends React.Component { } - namespace Tabs { - interface TabProps extends React.Props { - label?: any; - value?: string; - selected?: boolean; - width?: string; + interface BadgeProps extends React.Props { + badgeContent: React.ReactNode; + badgeStyle?: React.CSSProperties; + className?: string; + primary?: boolean; + secondary?: boolean; + style?: React.CSSProperties; + } + export class Badge extends React.Component { + } + + interface BeforeAfterWrapperProps extends React.Props { + afterElementType?: string; + afterStyle?: React.CSSProperties; + beforeElementType?: string; + beforeStyle?: React.CSSProperties; + elementType?: string; + style?: React.CSSProperties; + } + export class BeforeAfterWrapper extends React.Component { + } + + // non generally overridden elements of EnhancedButton + interface SharedEnhancedButtonProps extends React.Props { + centerRipple?: boolean; + disableFocusRipple?: boolean; + disableKeyboardFocus?: boolean; + disableTouchRipple?: boolean; + focusRippleColor?: string; + focusRippleOpacity?: number; + keyboardFocused?: boolean; + linkButton?: boolean; + onBlur?: React.FocusEventHandler; + onFocus?: React.FocusEventHandler; + onKeyboardFocus?: (e: React.FocusEvent, isKeyboardFocused: boolean) => void; + onKeyDown?: React.KeyboardEventHandler; + onKeyUp?: React.KeyboardEventHandler; + onTouchTap?: TouchTapEventHandler; + style?: React.CSSProperties; + tabIndex?: number; + touchRippleColor?: string; + touchRippleOpacity?: number; + type?: string; + } + + interface EnhancedButtonProps extends React.HTMLAttributes, SharedEnhancedButtonProps { + // container element,