aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/custom-typings.d.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/custom-typings.d.ts')
-rw-r--r--client/src/custom-typings.d.ts134
1 files changed, 0 insertions, 134 deletions
diff --git a/client/src/custom-typings.d.ts b/client/src/custom-typings.d.ts
deleted file mode 100644
index 882d15d54..000000000
--- a/client/src/custom-typings.d.ts
+++ /dev/null
@@ -1,134 +0,0 @@
1/* tslint: disable */
2
3/*
4 * Custom Type Definitions
5 * When including 3rd party modules you also need to include the type definition for the module
6 * if they don't provide one within the module. You can try to install it with @types
7
8npm install @types/node
9npm install @types/lodash
10
11 * If you can't find the type definition in the registry we can make an ambient/global definition in
12 * this file for now. For example
13
14declare module 'my-module' {
15 export function doesSomething(value: string): string;
16}
17
18 * If you are using a CommonJS module that is using module.exports then you will have to write your
19 * types using export = yourObjectOrFunction with a namespace above it
20 * notice how we have to create a namespace that is equal to the function we're
21 * assigning the export to
22
23declare module 'jwt-decode' {
24 function jwtDecode(token: string): any;
25 namespace jwtDecode {}
26 export = jwtDecode;
27}
28
29 *
30 * If you're prototying and you will fix the types later you can also declare it as type any
31 *
32
33declare var assert: any;
34declare var _: any;
35declare var $: any;
36
37 *
38 * If you're importing a module that uses Node.js modules which are CommonJS you need to import as
39 * in the files such as main.browser.ts or any file within app/
40 *
41
42import * as _ from 'lodash'
43
44 * You can include your type definitions in this file until you create one for the @types
45 *
46 */
47
48// support NodeJS modules without type definitions
49declare module '*';
50
51/*
52// for legacy tslint etc to understand rename 'modern-lru' with your package
53// then comment out `declare module '*';`. For each new module copy/paste
54// this method of creating an `any` module type definition
55declare module 'modern-lru' {
56 let x: any;
57 export = x;
58}
59*/
60
61// Extra variables that live on Global that will be replaced by webpack DefinePlugin
62declare var ENV: string;
63declare var API_URL: string;
64declare var HMR: boolean;
65declare var System: SystemJS;
66
67interface SystemJS {
68 import: (path?: string) => Promise<any>;
69}
70
71interface GlobalEnvironment {
72 ENV: string;
73 API_URL: string;
74 HMR: boolean;
75 SystemJS: SystemJS;
76 System: SystemJS;
77}
78
79interface Es6PromiseLoader {
80 (id: string): (exportName?: string) => Promise<any>;
81}
82
83type FactoryEs6PromiseLoader = () => Es6PromiseLoader;
84type FactoryPromise = () => Promise<any>;
85
86type AsyncRoutes = {
87 [component: string]: Es6PromiseLoader |
88 Function |
89 FactoryEs6PromiseLoader |
90 FactoryPromise ;
91};
92
93type IdleCallbacks = Es6PromiseLoader |
94 Function |
95 FactoryEs6PromiseLoader |
96 FactoryPromise ;
97
98interface WebpackModule {
99 hot: {
100 data?: any,
101 idle: any,
102 accept(dependencies?: string | string[], callback?: (updatedDependencies?: any) => void): void;
103 decline(deps?: any | string | string[]): void;
104 dispose(callback?: (data?: any) => void): void;
105 addDisposeHandler(callback?: (data?: any) => void): void;
106 removeDisposeHandler(callback?: (data?: any) => void): void;
107 check(autoApply?: any, callback?: (err?: Error, outdatedModules?: any[]) => void): void;
108 apply(options?: any, callback?: (err?: Error, outdatedModules?: any[]) => void): void;
109 status(callback?: (status?: string) => void): void | string;
110 removeStatusHandler(callback?: (status?: string) => void): void;
111 };
112}
113
114interface WebpackRequire {
115 (id: string): any;
116 (paths: string[], callback: (...modules: any[]) => void): void;
117 ensure(ids: string[], callback: (req: WebpackRequire) => void, chunkName?: string): void;
118 context(directory: string, useSubDirectories?: boolean, regExp?: RegExp): WebpackContext;
119}
120
121interface WebpackContext extends WebpackRequire {
122 keys(): string[];
123}
124
125interface ErrorStackTraceLimit {
126 stackTraceLimit: number;
127}
128
129// Extend typings
130interface NodeRequire extends WebpackRequire {}
131interface ErrorConstructor extends ErrorStackTraceLimit {}
132interface NodeRequireFunction extends Es6PromiseLoader {}
133interface NodeModule extends WebpackModule {}
134interface Global extends GlobalEnvironment {}