@seam-rpc/core 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +144 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +51 -0
- package/package.json +4 -1
- package/src/index.ts +0 -61
- package/tsconfig.json +0 -113
package/README.md
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
<img width="1940" height="829" alt="image" src="https://github.com/user-attachments/assets/8a4a8a8b-1b57-4c1e-b6bb-ebab81ba8a32" />
|
|
2
|
+
|
|
3
|
+
# SeamRPC
|
|
4
|
+
|
|
5
|
+
## About
|
|
6
|
+
SeamRPC is a simple RPC library for client-server communication using TypeScript using Express for the server.
|
|
7
|
+
|
|
8
|
+
Making requests to the server is as simple as calling a function and SeamRPC sends it to server for you under the hood.
|
|
9
|
+
|
|
10
|
+
## Setup
|
|
11
|
+
### Server
|
|
12
|
+
Implement your API functions in a TypeScript file. It's recommended to split different routes into different files, all inside the same folder. You can also optionally include JSDoc comments for the functions. The returned value of an API function is sent from the server to the client. If an error is thrown in the API function in the server, the function throws an error in the client as well (Seam RPC internally responds with HTTP code 400 which the client interprets as an error).
|
|
13
|
+
|
|
14
|
+
> **Note:** For consistency reasons between server and client API functions, Seam RPC requires all API functions to return a Promise.
|
|
15
|
+
|
|
16
|
+
**Example:**
|
|
17
|
+
```
|
|
18
|
+
server-app
|
|
19
|
+
├─ index.ts
|
|
20
|
+
└─ api
|
|
21
|
+
├─ users.ts
|
|
22
|
+
└─ posts.ts
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`api/users.ts`
|
|
26
|
+
```ts
|
|
27
|
+
import { SeamFile } from "@seam-rpc/server";
|
|
28
|
+
|
|
29
|
+
export interface User {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const users: User[] = [];
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Creates a new user and returns its ID.
|
|
38
|
+
* @param name The name of the user.
|
|
39
|
+
* @returns ID of the newly created user.
|
|
40
|
+
*/
|
|
41
|
+
export async function createUser(name: string): Promise<string> {
|
|
42
|
+
const user = {
|
|
43
|
+
id: Date.now().toString(),
|
|
44
|
+
name
|
|
45
|
+
};
|
|
46
|
+
users.push(user);
|
|
47
|
+
return user.id;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Gets a user by ID.
|
|
52
|
+
* @param id The ID of the user.
|
|
53
|
+
* @returns The user object.
|
|
54
|
+
*/
|
|
55
|
+
export async function getUser(id: string): Promise<User | undefined> {
|
|
56
|
+
const user = users.find(e => e.id == id);
|
|
57
|
+
if (user)
|
|
58
|
+
return user;
|
|
59
|
+
else
|
|
60
|
+
throw new Error("user not found");
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Client
|
|
65
|
+
The client needs to have the same schema as your API so you can call the API functions and have autocomplete. Behind the scenes these functions will send an HTTP requests to the server. SeamRPC can automatically generate the client schema files. To do this, you can either run the command `seam-rpc gen-client <input-files> <output-folder>` or [define a config file](#config-file) and then run the command `seam-rpc gen-client`.
|
|
66
|
+
|
|
67
|
+
- `input-files` - Specify what files to generate the client files from. You can use [glob pattern](https://en.wikipedia.org/wiki/Glob_(programming)) to specify the files.
|
|
68
|
+
- `output-folder` - Specify the folder where to store the generated client api files.
|
|
69
|
+
|
|
70
|
+
**Example:**
|
|
71
|
+
`seam-rpc gen-client ./src/api/* ../server-app/src/api`
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
client-app
|
|
75
|
+
├─ index.ts
|
|
76
|
+
└─ api
|
|
77
|
+
├─ users.ts
|
|
78
|
+
└─ posts.ts
|
|
79
|
+
```
|
|
80
|
+
The api folder in the client contains the generated API client files, and should not be manually edited.
|
|
81
|
+
|
|
82
|
+
The generated `api/users.ts` file:
|
|
83
|
+
> Notice that the JSDoc comments are included in the client files.
|
|
84
|
+
```ts
|
|
85
|
+
import { callApi, SeamFile, ISeamFile } from "@seam-rpc/client";
|
|
86
|
+
export interface User {
|
|
87
|
+
id: string;
|
|
88
|
+
name: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Creates a new user and returns its ID.
|
|
92
|
+
* @param name The name of the user.
|
|
93
|
+
* @returns ID of the newly created user.
|
|
94
|
+
*/
|
|
95
|
+
export function createUser(name: string): Promise<string> { return callApi("users", "createUser", [name]); }
|
|
96
|
+
/**
|
|
97
|
+
* Gets a user by ID.
|
|
98
|
+
* @param id The ID of the user.
|
|
99
|
+
* @returns The user object.
|
|
100
|
+
*/
|
|
101
|
+
export function getUser(id: string): Promise<User | undefined> { return callApi("users", "getUser", [id]); }
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Config file
|
|
105
|
+
If you don't want to specify the input files and output folder every time you want to generate the client files, you can create a config file where you define these paths. You can create a `seam-rpc.config.json` file at the root of your project and use the following data:
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"inputFiles": "./src/api/*",
|
|
109
|
+
"outputFolder": "../client/src/api"
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
or you can automatically generate a file using `seam-rpc gen-config [input-files] [output-folder]`. If you don't specify the input files and output folder, it will use the default paths (see JSON above).
|
|
113
|
+
|
|
114
|
+
## Uploading and downloading files
|
|
115
|
+
Both server and client can send files seamlessly. Just use the SeamFile class for this. You can have a parameter as a file or an array/object containing a file. You can have deeply nested files inside objects.
|
|
116
|
+
|
|
117
|
+
A SeamFile has 3 properties:
|
|
118
|
+
- `data` - binary data
|
|
119
|
+
- `fileName` (optional) - name of the file
|
|
120
|
+
- `mimeType` (optional) - The MIME type of the file ([Learn more](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/MIME_types))
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
**Example:**
|
|
124
|
+
```ts
|
|
125
|
+
interface UserData {
|
|
126
|
+
id: string;
|
|
127
|
+
name: string;
|
|
128
|
+
avatar: SeamFile;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export async function updateUser(userId: string, userData: UserData): Promise<void> {
|
|
132
|
+
if (userData.avatar.mimeType != "image/png" && userData.avatar.mimeType != "image/jpeg")
|
|
133
|
+
throw new Error("Only PNGs and JPEGs allowed for avatar.");
|
|
134
|
+
|
|
135
|
+
users[userId].name = userData.name;
|
|
136
|
+
users[userId].avatar = userData.avatar.fileName;
|
|
137
|
+
writeFileSync(`../avatars/${userData.avatar.fileName}`, userData.avatar.data);
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Important notices
|
|
142
|
+
- The generated client files contain all imports from the api implementation file in the backend that import from the current relative folder (`./`). This is the simplest way I have to include imports (at least for now). It may import functions and unused symbols but that shouldn't be too worrying.
|
|
143
|
+
- Don't include backend/server functions inside the server api files.
|
|
144
|
+
- Only exported functions will be included in the client generated files.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface ISeamFile {
|
|
2
|
+
readonly data: Uint8Array;
|
|
3
|
+
readonly fileName?: string;
|
|
4
|
+
readonly mimeType?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class SeamFile implements ISeamFile {
|
|
7
|
+
readonly data: Uint8Array;
|
|
8
|
+
readonly fileName?: string | undefined;
|
|
9
|
+
readonly mimeType?: string | undefined;
|
|
10
|
+
constructor(data: Uint8Array, fileName?: string | undefined, mimeType?: string | undefined);
|
|
11
|
+
static fromJSON(data: ISeamFile): SeamFile;
|
|
12
|
+
}
|
|
13
|
+
export declare function extractFiles(input: unknown): {
|
|
14
|
+
json: any;
|
|
15
|
+
files: SeamFile[];
|
|
16
|
+
paths: (string | number)[][];
|
|
17
|
+
};
|
|
18
|
+
export declare function injectFiles(json: any, files: {
|
|
19
|
+
path: (string | number)[];
|
|
20
|
+
file: ISeamFile;
|
|
21
|
+
}[]): void;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SeamFile = void 0;
|
|
4
|
+
exports.extractFiles = extractFiles;
|
|
5
|
+
exports.injectFiles = injectFiles;
|
|
6
|
+
class SeamFile {
|
|
7
|
+
constructor(data, fileName, mimeType) {
|
|
8
|
+
this.data = data;
|
|
9
|
+
this.fileName = fileName;
|
|
10
|
+
this.mimeType = mimeType;
|
|
11
|
+
}
|
|
12
|
+
static fromJSON(data) {
|
|
13
|
+
return new SeamFile(data.data, data.fileName, data.mimeType);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.SeamFile = SeamFile;
|
|
17
|
+
function extractFiles(input) {
|
|
18
|
+
const files = [];
|
|
19
|
+
const paths = [];
|
|
20
|
+
function walk(value, path) {
|
|
21
|
+
if (value instanceof SeamFile) {
|
|
22
|
+
files.push(value);
|
|
23
|
+
paths.push(path);
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
if (Array.isArray(value)) {
|
|
27
|
+
return value.map((e, index) => walk(e, [...path, index]));
|
|
28
|
+
}
|
|
29
|
+
if (value && typeof value === "object") {
|
|
30
|
+
return Object.fromEntries(Object.entries(value).map(([k, v]) => [k, walk(v, [...path, k])]));
|
|
31
|
+
}
|
|
32
|
+
return value;
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
json: walk(input, []),
|
|
36
|
+
files,
|
|
37
|
+
paths,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function injectFiles(json, files) {
|
|
41
|
+
for (const file of files) {
|
|
42
|
+
let value = json;
|
|
43
|
+
for (let i = 0; i < file.path.length; i++) {
|
|
44
|
+
const key = file.path[i];
|
|
45
|
+
if (i < file.path.length - 1)
|
|
46
|
+
value = value[key];
|
|
47
|
+
else
|
|
48
|
+
value[key] = SeamFile.fromJSON(file.file);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
package/package.json
CHANGED
package/src/index.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
export interface ISeamFile {
|
|
2
|
-
readonly data: Uint8Array;
|
|
3
|
-
readonly fileName?: string;
|
|
4
|
-
readonly mimeType?: string;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export class SeamFile implements ISeamFile {
|
|
8
|
-
constructor(
|
|
9
|
-
public readonly data: Uint8Array,
|
|
10
|
-
public readonly fileName?: string,
|
|
11
|
-
public readonly mimeType?: string
|
|
12
|
-
) { }
|
|
13
|
-
|
|
14
|
-
public static fromJSON(data: ISeamFile): SeamFile {
|
|
15
|
-
return new SeamFile(data.data, data.fileName, data.mimeType);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function extractFiles(input: unknown) {
|
|
20
|
-
const files: SeamFile[] = [];
|
|
21
|
-
const paths: (string | number)[][] = [];
|
|
22
|
-
|
|
23
|
-
function walk(value: unknown, path: (string | number)[]): any {
|
|
24
|
-
if (value instanceof SeamFile) {
|
|
25
|
-
files.push(value);
|
|
26
|
-
paths.push(path);
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (Array.isArray(value)) {
|
|
31
|
-
return value.map((e, index) => walk(e, [...path, index]));
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (value && typeof value === "object") {
|
|
35
|
-
return Object.fromEntries(
|
|
36
|
-
Object.entries(value).map(([k, v]) => [k, walk(v, [...path, k])])
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return value;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return {
|
|
44
|
-
json: walk(input, []),
|
|
45
|
-
files,
|
|
46
|
-
paths,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function injectFiles(json: any, files: { path: (string | number)[], file: ISeamFile }[]) {
|
|
51
|
-
for (const file of files) {
|
|
52
|
-
let value = json;
|
|
53
|
-
for (let i = 0; i < file.path.length; i++) {
|
|
54
|
-
const key = file.path[i];
|
|
55
|
-
if (i < file.path.length - 1)
|
|
56
|
-
value = value[key];
|
|
57
|
-
else
|
|
58
|
-
value[key] = SeamFile.fromJSON(file.file);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
/* Visit https://aka.ms/tsconfig to read more about this file */
|
|
4
|
-
|
|
5
|
-
/* Projects */
|
|
6
|
-
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
|
7
|
-
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
8
|
-
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
|
9
|
-
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
|
10
|
-
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
11
|
-
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
12
|
-
|
|
13
|
-
/* Language and Environment */
|
|
14
|
-
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
|
15
|
-
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
16
|
-
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
17
|
-
// "libReplacement": true, /* Enable lib replacement. */
|
|
18
|
-
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
|
19
|
-
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
20
|
-
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
|
21
|
-
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
22
|
-
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
|
23
|
-
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
|
24
|
-
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
25
|
-
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
26
|
-
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
27
|
-
|
|
28
|
-
/* Modules */
|
|
29
|
-
"module": "commonjs", /* Specify what module code is generated. */
|
|
30
|
-
"rootDir": "./src", /* Specify the root folder within your source files. */
|
|
31
|
-
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
32
|
-
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
33
|
-
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
34
|
-
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
35
|
-
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
|
36
|
-
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
37
|
-
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
38
|
-
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
39
|
-
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
|
|
40
|
-
// "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */
|
|
41
|
-
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
|
42
|
-
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
|
43
|
-
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
|
44
|
-
// "noUncheckedSideEffectImports": true, /* Check side effect imports. */
|
|
45
|
-
// "resolveJsonModule": true, /* Enable importing .json files. */
|
|
46
|
-
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
|
47
|
-
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
48
|
-
|
|
49
|
-
/* JavaScript Support */
|
|
50
|
-
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
|
51
|
-
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
52
|
-
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
|
53
|
-
|
|
54
|
-
/* Emit */
|
|
55
|
-
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
56
|
-
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
57
|
-
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
58
|
-
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
59
|
-
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
60
|
-
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
61
|
-
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
|
62
|
-
"outDir": "./dist", /* Specify an output folder for all emitted files. */
|
|
63
|
-
// "removeComments": true, /* Disable emitting comments. */
|
|
64
|
-
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
65
|
-
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
66
|
-
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
67
|
-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
68
|
-
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
69
|
-
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
70
|
-
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
71
|
-
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
|
72
|
-
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
|
73
|
-
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
74
|
-
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
|
75
|
-
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
76
|
-
|
|
77
|
-
/* Interop Constraints */
|
|
78
|
-
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
79
|
-
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
|
|
80
|
-
// "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */
|
|
81
|
-
// "erasableSyntaxOnly": true, /* Do not allow runtime constructs that are not part of ECMAScript. */
|
|
82
|
-
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
83
|
-
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
|
84
|
-
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
85
|
-
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
|
86
|
-
|
|
87
|
-
/* Type Checking */
|
|
88
|
-
"strict": true, /* Enable all strict type-checking options. */
|
|
89
|
-
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
|
90
|
-
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
|
91
|
-
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
92
|
-
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
|
93
|
-
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
94
|
-
// "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */
|
|
95
|
-
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
|
96
|
-
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
|
97
|
-
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
98
|
-
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
|
99
|
-
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
|
100
|
-
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
101
|
-
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
102
|
-
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
103
|
-
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
|
104
|
-
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
105
|
-
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
|
106
|
-
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
107
|
-
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
108
|
-
|
|
109
|
-
/* Completeness */
|
|
110
|
-
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
111
|
-
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
112
|
-
}
|
|
113
|
-
}
|