Showing
5 changed files
with
50 additions
and
14 deletions
common/index.ts
0 → 100644
1 | +export * from "./message"; |
common/message.ts
0 → 100644
1 | +export interface ServerInboundMessageMap { | ||
2 | + login: { | ||
3 | + username: string; | ||
4 | + }; | ||
5 | + roomList: { | ||
6 | + result: { | ||
7 | + uuid: string; | ||
8 | + name: string; | ||
9 | + currentUsers: number; | ||
10 | + maxUsers: number; | ||
11 | + }[]; | ||
12 | + }; | ||
13 | +} | ||
14 | + | ||
15 | +export interface ServerOutboundMessageMap { | ||
16 | + chat: { | ||
17 | + message: string; | ||
18 | + }; | ||
19 | +} |
common/tsconfig.json
0 → 100644
... | @@ -4,8 +4,8 @@ | ... | @@ -4,8 +4,8 @@ |
4 | 4 | ||
5 | /* Basic Options */ | 5 | /* Basic Options */ |
6 | // "incremental": true, /* Enable incremental compilation */ | 6 | // "incremental": true, /* Enable incremental compilation */ |
7 | - "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ | 7 | + "target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, |
8 | - "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ | 8 | + "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, |
9 | // "lib": [], /* Specify library files to be included in the compilation. */ | 9 | // "lib": [], /* Specify library files to be included in the compilation. */ |
10 | // "allowJs": true, /* Allow javascript files to be compiled. */ | 10 | // "allowJs": true, /* Allow javascript files to be compiled. */ |
11 | // "checkJs": true, /* Report errors in .js files. */ | 11 | // "checkJs": true, /* Report errors in .js files. */ |
... | @@ -25,7 +25,7 @@ | ... | @@ -25,7 +25,7 @@ |
25 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ | 25 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ |
26 | 26 | ||
27 | /* Strict Type-Checking Options */ | 27 | /* Strict Type-Checking Options */ |
28 | - "strict": true, /* Enable all strict type-checking options. */ | 28 | + "strict": true /* Enable all strict type-checking options. */, |
29 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ | 29 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ |
30 | // "strictNullChecks": true, /* Enable strict null checks. */ | 30 | // "strictNullChecks": true, /* Enable strict null checks. */ |
31 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ | 31 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ |
... | @@ -50,7 +50,7 @@ | ... | @@ -50,7 +50,7 @@ |
50 | // "typeRoots": [], /* List of folders to include type definitions from. */ | 50 | // "typeRoots": [], /* List of folders to include type definitions from. */ |
51 | // "types": [], /* Type declaration files to be included in compilation. */ | 51 | // "types": [], /* Type declaration files to be included in compilation. */ |
52 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ | 52 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ |
53 | - "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ | 53 | + "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, |
54 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ | 54 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ |
55 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ | 55 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ |
56 | 56 | ||
... | @@ -65,7 +65,12 @@ | ... | @@ -65,7 +65,12 @@ |
65 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ | 65 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ |
66 | 66 | ||
67 | /* Advanced Options */ | 67 | /* Advanced Options */ |
68 | - "skipLibCheck": true, /* Skip type checking of declaration files. */ | 68 | + "skipLibCheck": true /* Skip type checking of declaration files. */, |
69 | - "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ | 69 | + "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ |
70 | - } | 70 | + }, |
71 | + "references": [ | ||
72 | + { | ||
73 | + "path": "../common" | ||
74 | + } | ||
75 | + ] | ||
71 | } | 76 | } | ... | ... |
1 | { | 1 | { |
2 | "compilerOptions": { | 2 | "compilerOptions": { |
3 | "target": "es5", | 3 | "target": "es5", |
4 | - "lib": [ | 4 | + "lib": ["dom", "dom.iterable", "esnext"], |
5 | - "dom", | ||
6 | - "dom.iterable", | ||
7 | - "esnext" | ||
8 | - ], | ||
9 | "allowJs": true, | 5 | "allowJs": true, |
10 | "skipLibCheck": true, | 6 | "skipLibCheck": true, |
11 | "esModuleInterop": true, | 7 | "esModuleInterop": true, |
... | @@ -20,7 +16,10 @@ | ... | @@ -20,7 +16,10 @@ |
20 | "noEmit": true, | 16 | "noEmit": true, |
21 | "jsx": "react-jsx" | 17 | "jsx": "react-jsx" |
22 | }, | 18 | }, |
23 | - "include": [ | 19 | + "include": ["src"], |
24 | - "src" | 20 | + "references": [ |
21 | + { | ||
22 | + "path": "../common" | ||
23 | + } | ||
25 | ] | 24 | ] |
26 | } | 25 | } | ... | ... |
-
Please register or login to post a comment