diff --git a/.well-known/openapi.yaml b/.well-known/openapi.yaml index 31a6541..7f061c9 100644 --- a/.well-known/openapi.yaml +++ b/.well-known/openapi.yaml @@ -12,10 +12,10 @@ info: url: https://okikio.dev termsOfService: https://okikio.dev/terms servers: - - url: https://ts-check.deno.dev/ + - url: https://ts-check.okikio.dev/ description: Main server externalDocs: - description: Shiki Twoslash's documentation, it not quite the same as the full TypeScript Twoslash docs but it should cover all the basics required + description: Shiki Twoslash's documentation, is not quite the same as the full TypeScript Twoslash docs but it should cover all the basics required url: https://shikijs.github.io/twoslash/ paths: /twoslash: @@ -24,7 +24,7 @@ paths: summary: Run TypeScript Twoslash on a given code description: | This endpoint accepts TwoSlashOptions as JSON/FormData and returns TwoSlashReturn JSON. - Used for transforming TypeScript code with twoslash options. + Used for transforming TypeScript and Javascript code with twoslash options. Supports ts, js, tsx, jsx. requestBody: required: true @@ -48,6 +48,58 @@ paths: text/plain: schema: $ref: '#/components/schemas/TwoslashError' + get: + operationId: getTypescriptTwoslash + summary: Run TypeScript Twoslash on a given code + description: | + This endpoint accepts TwoSlashOptions as JSON/FormData and returns TwoSlashReturn JSON. + Used for transforming TypeScript and Javascript code with twoslash options. + Supports ts, js, tsx, jsx. + parameters: + - name: options + in: query + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TwoSlashOptions' + - name: option + in: query + content: + application/json: + schema: + $ref: '#/components/schemas/TwoSlashOptions' + - name: code + in: query + content: + text/plain: + schema: + $ref: '#/components/schemas/TwoSlashOptions/properties/code' + - name: extension + in: query + content: + text/plain: + schema: + $ref: '#/components/schemas/TwoSlashOptions/properties/extension' + - name: ext + in: query + content: + text/plain: + schema: + $ref: '#/components/schemas/TwoSlashOptions/properties/extension' + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/TwoSlashReturn' + '400': + description: Errors were thrown in the sample, but not included in an errors tag + content: + text/plain: + schema: + $ref: '#/components/schemas/TwoslashError' components: schemas: TwoSlashOptions: @@ -125,97 +177,100 @@ components: - `// @declarationMap`: Generates a sourcemap for each corresponding '.d.ts' file. - `// @downlevelIteration`: Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. - `// @emitBOM`: Specifies whether to emit a byte order mark (BOM) in emitted files. The byte order mark (BOM) is a Unicode character that serves as an indicator for the encoding of a text file. By default, TypeScript emits files without a BOM. Enabling `emitBOM` instructs TypeScript to include the BOM character at the beginning of emitted files, which can be useful for compatibility with certain tools and environments. - example: | - // @module: esnext - // @target: ES2022 - // @errors: 1003 2304 7006 2339 - // @declaration: true - // @emit - // @filename: maths.ts - /** - * Gets the length of a string - * @param value a string - */ - function fnx2(s: string) { - console.log(s.substr(3)) - } - export function absolute(num: number) { - if (num < 0) return num * -1; - return num; - } - - import {SpringEasing} from "spring-easing" - SpringEasing - // ^? - - /** - * Gets the length of a string - * @param value a string - */ - function fnx(s: string) { - console.log(s.substr(3)) - } - - export const slash = [] as string[] - fnx("42") - //^? - // ^^^^^ - - function greet(person: string, date: Date) { - console.log(\`Hello \${person}, today is \${date.toDateString()}!\`) - } - - greet("Maddison", new Date()) - // ^^^^^ A Quick explanation - console.g - // ^| - - // @filename: index.ts - import {absolute} from "./maths" - const value = absolute(-1) - // ^? - // ^^^^^^^^^^ - const value2 = absolute(-2) - // ^? - // ^^^^^^^^ - - function fn(s) { - console.log(s.substr(3)) - } + examples: + - | + // @module: esnext + // @target: ES2022 + // @errors: 1003 2304 7006 2339 + // @declaration: true + // @emit + // @filename: maths.ts + /** + * Gets the length of a string + * @param value a string + */ + function fnx2(s: string) { + console.log(s.substr(3)) + } + export function absolute(num: number) { + if (num < 0) return num * -1; + return num; + } + + import {SpringEasing} from "spring-easing" + SpringEasing + // ^? + + /** + * Gets the length of a string + * @param value a string + */ + function fnx(s: string) { + console.log(s.substr(3)) + } + + export const slash = [] as string[] + fnx("42") + //^? + // ^^^^^ + + function greet(person: string, date: Date) { + console.log(\`Hello \${person}, today is \${date.toDateString()}!\`) + } + + greet("Maddison", new Date()) + // ^^^^^ A Quick explanation + console.g + // ^| + + // @filename: index.ts + import {absolute} from "./maths" + const value = absolute(-1) + // ^? + // ^^^^^^^^^^ + const value2 = absolute(-2) + // ^? + // ^^^^^^^^ + + function fn(s) { + console.log(s.substr(3)) + } extension: type: string description: The extension of the code file. Can be 'typescript', 'javascript', 'json', 'jsn', 'ts', 'js', 'tsx', or 'jsx'. - example: "ts" + examples: + - "ts" defaultOptions: $ref: '#/components/schemas/ExampleOptions' defaultCompilerOptions: $ref: '#/components/schemas/CompilerOptions' fsMap: type: object - example: - 'index.ts': 'export const x = 10' + examples: + - 'index.ts': 'export const x = 10' customTags: type: array items: type: string - example: ['tag1', 'tag2'] - example: - code: | - const abolute = (num: number) => num < 0 ? num * -1 : num - // ^? - extension: 'ts' - defaultOptions: - noErrors: false - errors: [1016, 2307] - noStaticSemanticInfo: false - emit: false - noErrorValidation: false - defaultCompilerOptions: - target: 'es2022' - module: 'es2022' - fsMap: - 'index.ts': 'export const x = 10' - customTags: ['tag1', 'tag2'] + examples: ['tag1', 'tag2'] + examples: + - + code: | + const abolute = (num: number) => num < 0 ? num * -1 : num + // ^? + extension: 'ts' + defaultOptions: + noErrors: false + errors: [1016, 2307] + noStaticSemanticInfo: false + emit: false + noErrorValidation: false + defaultCompilerOptions: + target: 'es2022' + module: 'es2022' + fsMap: + 'index.ts': 'export const x = 10' + customTags: ['tag1', 'tag2'] required: - code - extension @@ -274,897 +329,898 @@ components: description: Any non breaking error that occurred in twoslash or typescript. playgroundURL: type: string - example: - code: | - // @filename: maths.ts - /** - * Gets the length of a string - * @param value a string - */ - function fnx2(s: string) { - console.log(s.substr(3)) - } - export function absolute(num: number) { - if (num < 0) return num * -1; - return num; - } - - import {SpringEasing} from "spring-easing" - SpringEasing - - /** - * Gets the length of a string - * @param value a string - */ - function fnx(s: string) { - console.log(s.substr(3)) - } - - export const slash = [] as string[] - fnx("42") - - function greet(person: string, date: Date) { - console.log(`Hello ${person}, today is ${date.toDateString()}!`) - } - - greet("Maddison", new Date()) - console.g - - // @filename: index.ts - import {absolute} from "./maths" - const value = absolute(-1) - const value2 = absolute(-2) - - function fn(s) { - console.log(s.substr(3)) - } - extension: ts - highlights: - - kind: highlight - offset: 370 - length: 11 - text: '' - line: 21 - start: 14 - - kind: highlight - offset: 425 - length: 7 - text: You need a description for highlight to work properly - line: 27 - start: 3 - - kind: highlight - offset: 553 - length: 5 - text: A Quick explanation - line: 34 - start: 3 - - kind: highlight - offset: 39 - length: 6 - text: Velue - line: 2 - start: 6 - - kind: highlight - offset: 66 - length: 6 - text: Value2 - line: 5 - start: 6 - queries: - - docs: >- - Generates an Array of values using frame functions which in turn create - the effect of spring easing. - - To use this properly make sure to set the easing animation option to - "linear". - - Check out a demo of SpringEasing at - - - - SpringEasing has 3 properties they are `easing` (all the easings from -
{@link
EasingFunctions
}
are supported on top of frame - functions like SpringFrame, SpringFrameOut, etc..), `numPoints` (the size - of the Array the frame function should create), and `decimal` (the number - of decimal places of the values within said Array). - - - | Properties | Default Value | - - | ----------- | ----------------------- | - - | `easing` | `spring(1, 100, 10, 0)` | - - | `numPoints` | `50` | - - | `decimal` | `3` | - + examples: + - + code: | + // @filename: maths.ts + /** + * Gets the length of a string + * @param value a string + */ + function fnx2(s: string) { + console.log(s.substr(3)) + } + export function absolute(num: number) { + if (num < 0) return num * -1; + return num; + } - By default, Spring Easing support easings in the form, + import {SpringEasing} from "spring-easing" + SpringEasing + /** + * Gets the length of a string + * @param value a string + */ + function fnx(s: string) { + console.log(s.substr(3)) + } - | constant | accelerate | decelerate | accelerate-decelerate - | decelerate-accelerate | + export const slash = [] as string[] + fnx("42") - | :--------- | :----------------- | :------------- | :-------------------- - | :-------------------- | + function greet(person: string, date: Date) { + console.log(`Hello ${person}, today is ${date.toDateString()}!`) + } - | | spring / spring-in | spring-out | spring-in-out - | spring-out-in | + greet("Maddison", new Date()) + console.g + // @filename: index.ts + import {absolute} from "./maths" + const value = absolute(-1) + const value2 = absolute(-2) - All **Spring** easing's can be configured using theses parameters, + function fn(s) { + console.log(s.substr(3)) + } + extension: ts + highlights: + - kind: highlight + offset: 370 + length: 11 + text: '' + line: 21 + start: 14 + - kind: highlight + offset: 425 + length: 7 + text: You need a description for highlight to work properly + line: 27 + start: 3 + - kind: highlight + offset: 553 + length: 5 + text: A Quick explanation + line: 34 + start: 3 + - kind: highlight + offset: 39 + length: 6 + text: Velue + line: 2 + start: 6 + - kind: highlight + offset: 66 + length: 6 + text: Value2 + line: 5 + start: 6 + queries: + - docs: >- + Generates an Array of values using frame functions which in turn create + the effect of spring easing. + To use this properly make sure to set the easing animation option to + "linear". - `spring-*(mass, stiffness, damping, velocity)` + Check out a demo of SpringEasing at + - Each parameter comes with these defaults + SpringEasing has 3 properties they are `easing` (all the easings from +
{@link
EasingFunctions
}
are supported on top of frame + functions like SpringFrame, SpringFrameOut, etc..), `numPoints` (the size + of the Array the frame function should create), and `decimal` (the number + of decimal places of the values within said Array). - | Parameter | Default Value | + | Properties | Default Value | - | --------- | ------------- | + | ----------- | ----------------------- | - | mass | `1` | + | `easing` | `spring(1, 100, 10, 0)` | - | stiffness | `100` | + | `numPoints` | `50` | - | damping | `10` | - - | velocity | `0` | - - e.g. - ```ts - import { SpringEasing, SpringOutFrame } from "spring-easing"; - import anime from "animejs"; - - // Note: this is the return value of
{@link
SpringEasing
}
and
{@link
GenerateSpringFrames
}
, you don't need the object to get this format - let [translateX, duration] = SpringEasing([0, 250], { - easing: "spring-out-in(1, 100, 10, 0)", - - // You can change the size of Array for the SpringEasing function to generate - numPoints: 200, - - // The number of decimal places to round, final values in the generated Array - // This option doesn't exist on
{@link
GenerateSpringFrames
}
- decimal: 5, - }); - - anime({ - targets: "div", - - // Using spring easing animate from [0 to 250] using `spring-out-in` - translateX, - - // You can set the easing without an object - rotate: SpringEasing(["0turn", 1, 0, 0.5], [SpringOutFrame, 1, 100, 10, 0])[0], - - // TIP... Use linear easing for the proper effect - easing: "linear", - - // The optimal duration for this specific spring - duration - }) - ``` - kind: query - start: 255 - length: 197 - text: >- - (alias) function SpringEasing(values: T[], options?: TypeEasingOptions - | TypeEasingOptions["easing"], customInterpolate?: - TypeInterpolationFunction): readonly [any[], number] - - import SpringEasing - offset: 3 - line: 14 - - docs: Gets the length of a string - kind: query - start: 421 - length: 29 - text: 'function fnx(s: string): void' - offset: 2 - line: 26 - - completions: - - name: assert - kind: method - kindModifiers: declare - sortText: '11' - - name: clear - kind: method - kindModifiers: declare - sortText: '11' - - name: count - kind: method - kindModifiers: declare - sortText: '11' - - name: countReset - kind: method - kindModifiers: declare - sortText: '11' - - name: debug - kind: method - kindModifiers: declare - sortText: '11' - - name: dir - kind: method - kindModifiers: declare - sortText: '11' - - name: dirxml - kind: method - kindModifiers: declare - sortText: '11' - - name: error - kind: method - kindModifiers: declare - sortText: '11' - - name: group - kind: method - kindModifiers: declare - sortText: '11' - - name: groupCollapsed - kind: method - kindModifiers: declare - sortText: '11' - - name: groupEnd - kind: method - kindModifiers: declare - sortText: '11' - - name: info - kind: method - kindModifiers: declare - sortText: '11' - - name: log - kind: method - kindModifiers: declare - sortText: '11' - - name: table - kind: method - kindModifiers: declare - sortText: '11' - - name: time - kind: method - kindModifiers: declare - sortText: '11' - - name: timeEnd - kind: method - kindModifiers: declare - sortText: '11' - - name: timeLog - kind: method - kindModifiers: declare - sortText: '11' - - name: timeStamp - kind: method - kindModifiers: declare - sortText: '11' - - name: trace - kind: method - kindModifiers: declare - sortText: '11' - - name: warn - kind: method - kindModifiers: declare - sortText: '11' - kind: completions - start: 662 - completionsPrefix: g - length: 1 - offset: 9 - line: 35 - - docs: '' - kind: query - start: 40 - length: 19 - text: 'const value: number' - offset: 7 - line: 2 - - docs: '' - kind: query - start: 77 - length: 20 - text: 'const value2: number' - offset: 7 - line: 4 - staticQuickInfos: - - text: 'function fnx2(s: string): void' - docs: Gets the length of a string - start: 73 - length: 4 - line: 3 - character: 14 - targetString: fnx2 - - text: '(parameter) s: string' - docs: '' - start: 78 - length: 1 - line: 3 - character: 19 - targetString: s - - text: 'var console: Console' - docs: '' - start: 93 - length: 7 - line: 5 - character: 5 - targetString: console - - text: '(method) Console.log(...data: any[]): void' - docs: '' - start: 101 - length: 3 - line: 5 - character: 13 - targetString: log - - text: '(parameter) s: string' - docs: '' - start: 105 - length: 1 - line: 5 - character: 17 - targetString: s - - text: '(method) String.substr(from: number, length?: number | undefined): string' - docs: >- - Gets a substring beginning at the specified location and having the - specified length. - start: 107 - length: 6 - line: 5 - character: 19 - targetString: substr - - text: 'function absolute(num: number): number' - docs: '' - start: 136 - length: 8 - line: 6 - character: 21 - targetString: absolute - - text: '(parameter) num: number' - docs: '' - start: 145 - length: 3 - line: 8 - character: 1 - targetString: num - - text: '(parameter) num: number' - docs: '' - start: 166 - length: 3 - line: 8 - character: 22 - targetString: num - - text: '(parameter) num: number' - docs: '' - start: 182 - length: 3 - line: 8 - character: 38 - targetString: num - - text: '(parameter) num: number' - docs: '' - start: 201 - length: 3 - line: 9 - character: 17 - targetString: num - - text: >- - (alias) function SpringEasing(values: T[], options?: TypeEasingOptions - | TypeEasingOptions["easing"], customInterpolate?: - TypeInterpolationFunction): readonly [any[], number] - - import SpringEasing - docs: >- - Generates an Array of values using frame functions which in turn create - the effect of spring easing. - - To use this properly make sure to set the easing animation option to - "linear". - - Check out a demo of SpringEasing at - - - - SpringEasing has 3 properties they are `easing` (all the easings from - {@link EasingFunctions} are supported on top of frame functions like - SpringFrame, SpringFrameOut, etc..), `numPoints` (the size of the Array - the frame function should create), and `decimal` (the number of decimal - places of the values within said Array). - - - | Properties | Default Value | - - | ----------- | ----------------------- | - - | `easing` | `spring(1, 100, 10, 0)` | - - | `numPoints` | `50` | - - | `decimal` | `3` | - - - By default, Spring Easing support easings in the form, - - - | constant | accelerate | decelerate | accelerate-decelerate - | decelerate-accelerate | + | `decimal` | `3` | + + + By default, Spring Easing support easings in the form, + + + | constant | accelerate | decelerate | accelerate-decelerate + | decelerate-accelerate | + + | :--------- | :----------------- | :------------- | :-------------------- + | :-------------------- | + + | | spring / spring-in | spring-out | spring-in-out + | spring-out-in | + + + All **Spring** easing's can be configured using theses parameters, + + + `spring-*(mass, stiffness, damping, velocity)` + + + Each parameter comes with these defaults + + + | Parameter | Default Value | + + | --------- | ------------- | + + | mass | `1` | + + | stiffness | `100` | + + | damping | `10` | + + | velocity | `0` | + + e.g. + ```ts + import { SpringEasing, SpringOutFrame } from "spring-easing"; + import anime from "animejs"; + + // Note: this is the return value of
{@link
SpringEasing
}
and
{@link
GenerateSpringFrames
}
, you don't need the object to get this format + let [translateX, duration] = SpringEasing([0, 250], { + easing: "spring-out-in(1, 100, 10, 0)", + + // You can change the size of Array for the SpringEasing function to generate + numPoints: 200, + + // The number of decimal places to round, final values in the generated Array + // This option doesn't exist on
{@link
GenerateSpringFrames
}
+ decimal: 5, + }); + + anime({ + targets: "div", + + // Using spring easing animate from [0 to 250] using `spring-out-in` + translateX, + + // You can set the easing without an object + rotate: SpringEasing(["0turn", 1, 0, 0.5], [SpringOutFrame, 1, 100, 10, 0])[0], + + // TIP... Use linear easing for the proper effect + easing: "linear", + + // The optimal duration for this specific spring + duration + }) + ``` + kind: query + start: 255 + length: 197 + text: >- + (alias) function SpringEasing(values: T[], options?: TypeEasingOptions + | TypeEasingOptions["easing"], customInterpolate?: + TypeInterpolationFunction): readonly [any[], number] + + import SpringEasing + offset: 3 + line: 14 + - docs: Gets the length of a string + kind: query + start: 421 + length: 29 + text: 'function fnx(s: string): void' + offset: 2 + line: 26 + - completions: + - name: assert + kind: method + kindModifiers: declare + sortText: '11' + - name: clear + kind: method + kindModifiers: declare + sortText: '11' + - name: count + kind: method + kindModifiers: declare + sortText: '11' + - name: countReset + kind: method + kindModifiers: declare + sortText: '11' + - name: debug + kind: method + kindModifiers: declare + sortText: '11' + - name: dir + kind: method + kindModifiers: declare + sortText: '11' + - name: dirxml + kind: method + kindModifiers: declare + sortText: '11' + - name: error + kind: method + kindModifiers: declare + sortText: '11' + - name: group + kind: method + kindModifiers: declare + sortText: '11' + - name: groupCollapsed + kind: method + kindModifiers: declare + sortText: '11' + - name: groupEnd + kind: method + kindModifiers: declare + sortText: '11' + - name: info + kind: method + kindModifiers: declare + sortText: '11' + - name: log + kind: method + kindModifiers: declare + sortText: '11' + - name: table + kind: method + kindModifiers: declare + sortText: '11' + - name: time + kind: method + kindModifiers: declare + sortText: '11' + - name: timeEnd + kind: method + kindModifiers: declare + sortText: '11' + - name: timeLog + kind: method + kindModifiers: declare + sortText: '11' + - name: timeStamp + kind: method + kindModifiers: declare + sortText: '11' + - name: trace + kind: method + kindModifiers: declare + sortText: '11' + - name: warn + kind: method + kindModifiers: declare + sortText: '11' + kind: completions + start: 662 + completionsPrefix: g + length: 1 + offset: 9 + line: 35 + - docs: '' + kind: query + start: 40 + length: 19 + text: 'const value: number' + offset: 7 + line: 2 + - docs: '' + kind: query + start: 77 + length: 20 + text: 'const value2: number' + offset: 7 + line: 4 + staticQuickInfos: + - text: 'function fnx2(s: string): void' + docs: Gets the length of a string + start: 73 + length: 4 + line: 3 + character: 14 + targetString: fnx2 + - text: '(parameter) s: string' + docs: '' + start: 78 + length: 1 + line: 3 + character: 19 + targetString: s + - text: 'var console: Console' + docs: '' + start: 93 + length: 7 + line: 5 + character: 5 + targetString: console + - text: '(method) Console.log(...data: any[]): void' + docs: '' + start: 101 + length: 3 + line: 5 + character: 13 + targetString: log + - text: '(parameter) s: string' + docs: '' + start: 105 + length: 1 + line: 5 + character: 17 + targetString: s + - text: '(method) String.substr(from: number, length?: number | undefined): string' + docs: >- + Gets a substring beginning at the specified location and having the + specified length. + start: 107 + length: 6 + line: 5 + character: 19 + targetString: substr + - text: 'function absolute(num: number): number' + docs: '' + start: 136 + length: 8 + line: 6 + character: 21 + targetString: absolute + - text: '(parameter) num: number' + docs: '' + start: 145 + length: 3 + line: 8 + character: 1 + targetString: num + - text: '(parameter) num: number' + docs: '' + start: 166 + length: 3 + line: 8 + character: 22 + targetString: num + - text: '(parameter) num: number' + docs: '' + start: 182 + length: 3 + line: 8 + character: 38 + targetString: num + - text: '(parameter) num: number' + docs: '' + start: 201 + length: 3 + line: 9 + character: 17 + targetString: num + - text: >- + (alias) function SpringEasing(values: T[], options?: TypeEasingOptions + | TypeEasingOptions["easing"], customInterpolate?: + TypeInterpolationFunction): readonly [any[], number] + + import SpringEasing + docs: >- + Generates an Array of values using frame functions which in turn create + the effect of spring easing. + + To use this properly make sure to set the easing animation option to + "linear". + + Check out a demo of SpringEasing at + + + + SpringEasing has 3 properties they are `easing` (all the easings from + {@link EasingFunctions} are supported on top of frame functions like + SpringFrame, SpringFrameOut, etc..), `numPoints` (the size of the Array + the frame function should create), and `decimal` (the number of decimal + places of the values within said Array). + + + | Properties | Default Value | + + | ----------- | ----------------------- | + + | `easing` | `spring(1, 100, 10, 0)` | + + | `numPoints` | `50` | + + | `decimal` | `3` | + + + By default, Spring Easing support easings in the form, + + + | constant | accelerate | decelerate | accelerate-decelerate + | decelerate-accelerate | - | :--------- | :----------------- | :------------- | :-------------------- - | :-------------------- | + | :--------- | :----------------- | :------------- | :-------------------- + | :-------------------- | - | | spring / spring-in | spring-out | spring-in-out - | spring-out-in | + | | spring / spring-in | spring-out | spring-in-out + | spring-out-in | - All **Spring** easing's can be configured using theses parameters, + All **Spring** easing's can be configured using theses parameters, - `spring-*(mass, stiffness, damping, velocity)` + `spring-*(mass, stiffness, damping, velocity)` - Each parameter comes with these defaults + Each parameter comes with these defaults - | Parameter | Default Value | + | Parameter | Default Value | - | --------- | ------------- | + | --------- | ------------- | - | mass | `1` | + | mass | `1` | - | stiffness | `100` | + | stiffness | `100` | - | damping | `10` | + | damping | `10` | - | velocity | `0` | + | velocity | `0` | - e.g. - ```ts - import { SpringEasing, SpringOutFrame } from "spring-easing"; - import anime from "animejs"; + e.g. + ```ts + import { SpringEasing, SpringOutFrame } from "spring-easing"; + import anime from "animejs"; - // Note: this is the return value of {@link SpringEasing} and {@link GenerateSpringFrames}, you don't need the object to get this format - let [translateX, duration] = SpringEasing([0, 250], { - easing: "spring-out-in(1, 100, 10, 0)", + // Note: this is the return value of {@link SpringEasing} and {@link GenerateSpringFrames}, you don't need the object to get this format + let [translateX, duration] = SpringEasing([0, 250], { + easing: "spring-out-in(1, 100, 10, 0)", - // You can change the size of Array for the SpringEasing function to generate - numPoints: 200, + // You can change the size of Array for the SpringEasing function to generate + numPoints: 200, - // The number of decimal places to round, final values in the generated Array - // This option doesn't exist on {@link GenerateSpringFrames} - decimal: 5, - }); + // The number of decimal places to round, final values in the generated Array + // This option doesn't exist on {@link GenerateSpringFrames} + decimal: 5, + }); - anime({ - targets: "div", + anime({ + targets: "div", - // Using spring easing animate from [0 to 250] using `spring-out-in` - translateX, + // Using spring easing animate from [0 to 250] using `spring-out-in` + translateX, - // You can set the easing without an object - rotate: SpringEasing(["0turn", 1, 0, 0.5], [SpringOutFrame, 1, 100, 10, 0])[0], + // You can set the easing without an object + rotate: SpringEasing(["0turn", 1, 0, 0.5], [SpringOutFrame, 1, 100, 10, 0])[0], - // TIP... Use linear easing for the proper effect - easing: "linear", + // TIP... Use linear easing for the proper effect + easing: "linear", - // The optimal duration for this specific spring - duration - }) - ``` - start: 217 - length: 12 - line: 10 - character: 1 - targetString: SpringEasing - - text: >- - (alias) function SpringEasing(values: T[], options?: TypeEasingOptions - | TypeEasingOptions["easing"], customInterpolate?: - TypeInterpolationFunction): readonly [any[], number] + // The optimal duration for this specific spring + duration + }) + ``` + start: 217 + length: 12 + line: 10 + character: 1 + targetString: SpringEasing + - text: >- + (alias) function SpringEasing(values: T[], options?: TypeEasingOptions + | TypeEasingOptions["easing"], customInterpolate?: + TypeInterpolationFunction): readonly [any[], number] - import SpringEasing - docs: >- - Generates an Array of values using frame functions which in turn create - the effect of spring easing. + import SpringEasing + docs: >- + Generates an Array of values using frame functions which in turn create + the effect of spring easing. - To use this properly make sure to set the easing animation option to - "linear". + To use this properly make sure to set the easing animation option to + "linear". - Check out a demo of SpringEasing at - + Check out a demo of SpringEasing at + - SpringEasing has 3 properties they are `easing` (all the easings from - {@link EasingFunctions} are supported on top of frame functions like - SpringFrame, SpringFrameOut, etc..), `numPoints` (the size of the Array - the frame function should create), and `decimal` (the number of decimal - places of the values within said Array). + SpringEasing has 3 properties they are `easing` (all the easings from + {@link EasingFunctions} are supported on top of frame functions like + SpringFrame, SpringFrameOut, etc..), `numPoints` (the size of the Array + the frame function should create), and `decimal` (the number of decimal + places of the values within said Array). - | Properties | Default Value | + | Properties | Default Value | - | ----------- | ----------------------- | + | ----------- | ----------------------- | - | `easing` | `spring(1, 100, 10, 0)` | + | `easing` | `spring(1, 100, 10, 0)` | - | `numPoints` | `50` | + | `numPoints` | `50` | - | `decimal` | `3` | + | `decimal` | `3` | - By default, Spring Easing support easings in the form, + By default, Spring Easing support easings in the form, - | constant | accelerate | decelerate | accelerate-decelerate - | decelerate-accelerate | + | constant | accelerate | decelerate | accelerate-decelerate + | decelerate-accelerate | - | :--------- | :----------------- | :------------- | :-------------------- - | :-------------------- | + | :--------- | :----------------- | :------------- | :-------------------- + | :-------------------- | - | | spring / spring-in | spring-out | spring-in-out - | spring-out-in | + | | spring / spring-in | spring-out | spring-in-out + | spring-out-in | - All **Spring** easing's can be configured using theses parameters, + All **Spring** easing's can be configured using theses parameters, - `spring-*(mass, stiffness, damping, velocity)` + `spring-*(mass, stiffness, damping, velocity)` - Each parameter comes with these defaults + Each parameter comes with these defaults - | Parameter | Default Value | - - | --------- | ------------- | - - | mass | `1` | - - | stiffness | `100` | - - | damping | `10` | - - | velocity | `0` | - - e.g. - ```ts - import { SpringEasing, SpringOutFrame } from "spring-easing"; - import anime from "animejs"; - - // Note: this is the return value of {@link SpringEasing} and {@link GenerateSpringFrames}, you don't need the object to get this format - let [translateX, duration] = SpringEasing([0, 250], { - easing: "spring-out-in(1, 100, 10, 0)", - - // You can change the size of Array for the SpringEasing function to generate - numPoints: 200, - - // The number of decimal places to round, final values in the generated Array - // This option doesn't exist on {@link GenerateSpringFrames} - decimal: 5, - }); - - anime({ - targets: "div", - - // Using spring easing animate from [0 to 250] using `spring-out-in` - translateX, - - // You can set the easing without an object - rotate: SpringEasing(["0turn", 1, 0, 0.5], [SpringOutFrame, 1, 100, 10, 0])[0], - - // TIP... Use linear easing for the proper effect - easing: "linear", - - // The optimal duration for this specific spring - duration - }) - ``` - start: 252 - length: 12 - line: 13 - character: 19 - targetString: SpringEasing - - text: 'function fnx(s: string): void' - docs: Gets the length of a string - start: 345 - length: 3 - line: 18 - character: 20 - targetString: fnx - - text: '(parameter) s: string' - docs: '' - start: 349 - length: 1 - line: 18 - character: 24 - targetString: s - - text: 'var console: Console' - docs: '' - start: 364 - length: 7 - line: 20 - character: 10 - targetString: console - - text: '(method) Console.log(...data: any[]): void' - docs: '' - start: 372 - length: 3 - line: 20 - character: 18 - targetString: log - - text: '(parameter) s: string' - docs: '' - start: 376 - length: 1 - line: 20 - character: 22 - targetString: s - - text: '(method) String.substr(from: number, length?: number | undefined): string' - docs: >- - Gets a substring beginning at the specified location and having the - specified length. - start: 378 - length: 6 - line: 20 - character: 24 - targetString: substr - - text: 'const slash: string[]' - docs: '' - start: 432 - length: 5 - line: 24 - character: 22 - targetString: slash - - text: 'function fnx(s: string): void' - docs: Gets the length of a string - start: 457 - length: 3 - line: 25 - character: 11 - targetString: fnx - - text: 'function greet(person: string, date: Date): void' - docs: '' - start: 547 - length: 5 - line: 28 - character: 43 - targetString: greet - - text: '(parameter) person: string' - docs: '' - start: 553 - length: 6 - line: 28 - character: 49 - targetString: person - - text: '(parameter) date: Date' - docs: '' - start: 569 - length: 4 - line: 28 - character: 65 - targetString: date - - text: interface Date - docs: Enables basic storage and retrieval of dates and times. - start: 575 - length: 4 - line: 31 - character: 1 - targetString: Date - - text: 'var console: Console' - docs: '' - start: 585 - length: 7 - line: 31 - character: 11 - targetString: console - - text: '(method) Console.log(...data: any[]): void' - docs: '' - start: 593 - length: 3 - line: 31 - character: 19 - targetString: log - - text: '(parameter) person: string' - docs: '' - start: 606 - length: 6 - line: 31 - character: 32 - targetString: person - - text: '(parameter) date: Date' - docs: '' - start: 626 - length: 4 - line: 34 - character: 7 - targetString: date - - text: '(method) Date.toDateString(): string' - docs: Returns a date as a string value. - start: 631 - length: 12 - line: 34 - character: 12 - targetString: toDateString - - text: 'function greet(person: string, date: Date): void' - docs: '' - start: 656 - length: 5 - line: 35 - character: 13 - targetString: greet - - text: |- - var Date: DateConstructor - new () => Date (+4 overloads) - docs: '' - start: 678 - length: 4 - line: 36 - character: 2 - targetString: Date - - text: 'var console: Console' - docs: '' - start: 717 - length: 7 - line: 37 - character: 14 - targetString: console - - text: any - start: 725 - length: 1 - line: 37 - character: 22 - targetString: g - - text: |- - (alias) function absolute(num: number): number - import absolute - docs: '' - start: 8 - length: 8 - line: 0 - character: 8 - targetString: absolute - - text: 'const value: number' - docs: '' - start: 39 - length: 5 - line: 2 - character: 11 - targetString: value - - text: |- - (alias) absolute(num: number): number - import absolute - docs: '' - start: 47 - length: 8 - line: 2 - character: 19 - targetString: absolute - - text: 'const value2: number' - docs: '' - start: 95 - length: 6 - line: 5 - character: 7 - targetString: value2 - - text: |- - (alias) absolute(num: number): number - import absolute - docs: '' - start: 104 - length: 8 - line: 5 - character: 16 - targetString: absolute - - text: 'function fn(s: any): void' - docs: '' - start: 157 - length: 2 - line: 8 - character: 13 - targetString: fn - - text: '(parameter) s: any' - docs: '' - start: 160 - length: 1 - line: 8 - character: 16 - targetString: s - - text: 'var console: Console' - docs: '' - start: 167 - length: 7 - line: 8 - character: 23 - targetString: console - - text: '(method) Console.log(...data: any[]): void' - docs: '' - start: 175 - length: 3 - line: 8 - character: 31 - targetString: log - - text: '(parameter) s: any' - docs: '' - start: 179 - length: 1 - line: 8 - character: 35 - targetString: s - - text: any - start: 181 - length: 6 - line: 8 - character: 37 - targetString: substr - errors: - - category: 1 - code: 2339 - length: 1 - start: 749 - line: 36 - character: 8 - renderedMessage: Property 'g' does not exist on type 'Console'. - id: err-2339-725-1 - - category: 1 - code: 7006 - length: 1 - start: 803 - line: 8 - character: 12 - renderedMessage: Parameter 's' implicitly has an 'any' type. - id: err-7006-160-1 - warnings: - - category: 2 - code: 6133 - length: 4 - start: 97 - line: 4 - character: 9 - renderedMessage: '''fnx2'' is declared but its value is never read.' - id: warn-6133-73-4 - - category: 2 - code: 6387 - length: 6 - start: 131 - line: 5 - character: 16 - renderedMessage: >- - The signature '(from: number, length?: number | undefined): string' of - 's.substr' is deprecated. - id: warn-6387-107-6 - - category: 2 - code: 6387 - length: 6 - start: 402 - line: 21 - character: 16 - renderedMessage: >- - The signature '(from: number, length?: number | undefined): string' of - 's.substr' is deprecated. - id: warn-6387-378-6 - - category: 2 - code: 6133 - length: 5 - start: 682 - line: 1 - character: 6 - renderedMessage: '''value'' is declared but its value is never read.' - id: warn-6133-39-5 - - category: 2 - code: 6133 - length: 6 - start: 738 - line: 4 - character: 6 - renderedMessage: '''value2'' is declared but its value is never read.' - id: warn-6133-95-6 - - category: 2 - code: 6133 - length: 2 - start: 800 - line: 8 - character: 9 - renderedMessage: '''fn'' is declared but its value is never read.' - id: warn-6133-157-2 - playgroundURL: >- - https://www.typescriptlang.org/play/#code/PTAEAEFsHsBMFcA2BTAXKZBnAdsgHgC4BQIEBAhgE4DmyB6AogMoBMADCyyWOMpZdEqZ0ARjZsAzKBYS2AFlAB2cQDZpEiQE5uEWMgDGiKuQIBLaNnQFK8ZDt6RTxUuABmplNnKQ0oSCYALTAA6AkxQEgAqSKJQSNAAcTpwggDkUE9qVNBoV1ByUExrU2xqWPjwAAdjSFAAN3JEW3zC4tLy4CJXeGx9MwtQV2w8FgAKYVbKEuoASlAAb1jQfQtMaBRgxGhqceDMeAAjIspRiRmZogBfInxKwQJBnr7zbHyj9fgCZFHseEh0X6QA58OaLUCgUx5H5-UAAHlAbDmlDo8Eor0BcVAAFoRABuJbIgio9F-fHXIimSB3SgPeZMSpTUoMciYaaXQYCWoAIkwDOmWOQLOmXKI9MZ1GZrPapAAegB+IhRGKYpJhUCpdKZbK5FrHablCDVSjeeqNZoFPXtOKdbq9fqvIZ4cboS2zBZLFbYNYbLY7EL7I7WU7nHTgsPh8EyqPRmMyiLk273ZarB6YIyYAKgAC8oAA2gBdfLhV0FpaO0ZcuQsLkXEDynSxqOgACa0HgoFwyFgLT0mH0U0q9sGglAAVM1ACiHHAQeBGgoAA7oIANagBnQSp8RAAT0VtueA2oyLoo03QgsLra1AANKBYCZfAARB+gj2rdbITbbUYAAwAEsgiBbKAAAk8xnms2CXLec73tuELhGB95fKE0DPl8TBXqMMyXAAhD+FzkmGR7ICeXIALLkLAsCmJBXK3rgC6gOh3whrKMagAAgqAACK8CmPoq63EYXhDhEnrep+1ARKQEagDKAA+iouO4njeL4JR6HgoThBSVJJvM5DvE0Xzsq4nKgFywTAP4qSYCKEkPA0TTpDmRnep83w4rWYDhvWsmRrGoAAGqAbYRCOaaLksNmbweV8oxYiwPkRv5vmBRxwVmsgXBdE8Q5DOMr7ghJH5fn6eyHMcwaEUQQA - tags: [] + | Parameter | Default Value | + + | --------- | ------------- | + + | mass | `1` | + + | stiffness | `100` | + + | damping | `10` | + + | velocity | `0` | + + e.g. + ```ts + import { SpringEasing, SpringOutFrame } from "spring-easing"; + import anime from "animejs"; + + // Note: this is the return value of {@link SpringEasing} and {@link GenerateSpringFrames}, you don't need the object to get this format + let [translateX, duration] = SpringEasing([0, 250], { + easing: "spring-out-in(1, 100, 10, 0)", + + // You can change the size of Array for the SpringEasing function to generate + numPoints: 200, + + // The number of decimal places to round, final values in the generated Array + // This option doesn't exist on {@link GenerateSpringFrames} + decimal: 5, + }); + + anime({ + targets: "div", + + // Using spring easing animate from [0 to 250] using `spring-out-in` + translateX, + + // You can set the easing without an object + rotate: SpringEasing(["0turn", 1, 0, 0.5], [SpringOutFrame, 1, 100, 10, 0])[0], + + // TIP... Use linear easing for the proper effect + easing: "linear", + + // The optimal duration for this specific spring + duration + }) + ``` + start: 252 + length: 12 + line: 13 + character: 19 + targetString: SpringEasing + - text: 'function fnx(s: string): void' + docs: Gets the length of a string + start: 345 + length: 3 + line: 18 + character: 20 + targetString: fnx + - text: '(parameter) s: string' + docs: '' + start: 349 + length: 1 + line: 18 + character: 24 + targetString: s + - text: 'var console: Console' + docs: '' + start: 364 + length: 7 + line: 20 + character: 10 + targetString: console + - text: '(method) Console.log(...data: any[]): void' + docs: '' + start: 372 + length: 3 + line: 20 + character: 18 + targetString: log + - text: '(parameter) s: string' + docs: '' + start: 376 + length: 1 + line: 20 + character: 22 + targetString: s + - text: '(method) String.substr(from: number, length?: number | undefined): string' + docs: >- + Gets a substring beginning at the specified location and having the + specified length. + start: 378 + length: 6 + line: 20 + character: 24 + targetString: substr + - text: 'const slash: string[]' + docs: '' + start: 432 + length: 5 + line: 24 + character: 22 + targetString: slash + - text: 'function fnx(s: string): void' + docs: Gets the length of a string + start: 457 + length: 3 + line: 25 + character: 11 + targetString: fnx + - text: 'function greet(person: string, date: Date): void' + docs: '' + start: 547 + length: 5 + line: 28 + character: 43 + targetString: greet + - text: '(parameter) person: string' + docs: '' + start: 553 + length: 6 + line: 28 + character: 49 + targetString: person + - text: '(parameter) date: Date' + docs: '' + start: 569 + length: 4 + line: 28 + character: 65 + targetString: date + - text: interface Date + docs: Enables basic storage and retrieval of dates and times. + start: 575 + length: 4 + line: 31 + character: 1 + targetString: Date + - text: 'var console: Console' + docs: '' + start: 585 + length: 7 + line: 31 + character: 11 + targetString: console + - text: '(method) Console.log(...data: any[]): void' + docs: '' + start: 593 + length: 3 + line: 31 + character: 19 + targetString: log + - text: '(parameter) person: string' + docs: '' + start: 606 + length: 6 + line: 31 + character: 32 + targetString: person + - text: '(parameter) date: Date' + docs: '' + start: 626 + length: 4 + line: 34 + character: 7 + targetString: date + - text: '(method) Date.toDateString(): string' + docs: Returns a date as a string value. + start: 631 + length: 12 + line: 34 + character: 12 + targetString: toDateString + - text: 'function greet(person: string, date: Date): void' + docs: '' + start: 656 + length: 5 + line: 35 + character: 13 + targetString: greet + - text: |- + var Date: DateConstructor + new () => Date (+4 overloads) + docs: '' + start: 678 + length: 4 + line: 36 + character: 2 + targetString: Date + - text: 'var console: Console' + docs: '' + start: 717 + length: 7 + line: 37 + character: 14 + targetString: console + - text: any + start: 725 + length: 1 + line: 37 + character: 22 + targetString: g + - text: |- + (alias) function absolute(num: number): number + import absolute + docs: '' + start: 8 + length: 8 + line: 0 + character: 8 + targetString: absolute + - text: 'const value: number' + docs: '' + start: 39 + length: 5 + line: 2 + character: 11 + targetString: value + - text: |- + (alias) absolute(num: number): number + import absolute + docs: '' + start: 47 + length: 8 + line: 2 + character: 19 + targetString: absolute + - text: 'const value2: number' + docs: '' + start: 95 + length: 6 + line: 5 + character: 7 + targetString: value2 + - text: |- + (alias) absolute(num: number): number + import absolute + docs: '' + start: 104 + length: 8 + line: 5 + character: 16 + targetString: absolute + - text: 'function fn(s: any): void' + docs: '' + start: 157 + length: 2 + line: 8 + character: 13 + targetString: fn + - text: '(parameter) s: any' + docs: '' + start: 160 + length: 1 + line: 8 + character: 16 + targetString: s + - text: 'var console: Console' + docs: '' + start: 167 + length: 7 + line: 8 + character: 23 + targetString: console + - text: '(method) Console.log(...data: any[]): void' + docs: '' + start: 175 + length: 3 + line: 8 + character: 31 + targetString: log + - text: '(parameter) s: any' + docs: '' + start: 179 + length: 1 + line: 8 + character: 35 + targetString: s + - text: any + start: 181 + length: 6 + line: 8 + character: 37 + targetString: substr + errors: + - category: 1 + code: 2339 + length: 1 + start: 749 + line: 36 + character: 8 + renderedMessage: Property 'g' does not exist on type 'Console'. + id: err-2339-725-1 + - category: 1 + code: 7006 + length: 1 + start: 803 + line: 8 + character: 12 + renderedMessage: Parameter 's' implicitly has an 'any' type. + id: err-7006-160-1 + warnings: + - category: 2 + code: 6133 + length: 4 + start: 97 + line: 4 + character: 9 + renderedMessage: '''fnx2'' is declared but its value is never read.' + id: warn-6133-73-4 + - category: 2 + code: 6387 + length: 6 + start: 131 + line: 5 + character: 16 + renderedMessage: >- + The signature '(from: number, length?: number | undefined): string' of + 's.substr' is deprecated. + id: warn-6387-107-6 + - category: 2 + code: 6387 + length: 6 + start: 402 + line: 21 + character: 16 + renderedMessage: >- + The signature '(from: number, length?: number | undefined): string' of + 's.substr' is deprecated. + id: warn-6387-378-6 + - category: 2 + code: 6133 + length: 5 + start: 682 + line: 1 + character: 6 + renderedMessage: '''value'' is declared but its value is never read.' + id: warn-6133-39-5 + - category: 2 + code: 6133 + length: 6 + start: 738 + line: 4 + character: 6 + renderedMessage: '''value2'' is declared but its value is never read.' + id: warn-6133-95-6 + - category: 2 + code: 6133 + length: 2 + start: 800 + line: 8 + character: 9 + renderedMessage: '''fn'' is declared but its value is never read.' + id: warn-6133-157-2 + playgroundURL: >- + https://www.typescriptlang.org/play/#code/PTAEAEFsHsBMFcA2BTAXKZBnAdsgHgC4BQIEBAhgE4DmyB6AogMoBMADCyyWOMpZdEqZ0ARjZsAzKBYS2AFlAB2cQDZpEiQE5uEWMgDGiKuQIBLaNnQFK8ZDt6RTxUuABmplNnKQ0oSCYALTAA6AkxQEgAqSKJQSNAAcTpwggDkUE9qVNBoV1ByUExrU2xqWPjwAAdjSFAAN3JEW3zC4tLy4CJXeGx9MwtQV2w8FgAKYVbKEuoASlAAb1jQfQtMaBRgxGhqceDMeAAjIspRiRmZogBfInxKwQJBnr7zbHyj9fgCZFHseEh0X6QA58OaLUCgUx5H5-UAAHlAbDmlDo8Eor0BcVAAFoRABuJbIgio9F-fHXIimSB3SgPeZMSpTUoMciYaaXQYCWoAIkwDOmWOQLOmXKI9MZ1GZrPapAAegB+IhRGKYpJhUCpdKZbK5FrHablCDVSjeeqNZoFPXtOKdbq9fqvIZ4cboS2zBZLFbYNYbLY7EL7I7WU7nHTgsPh8EyqPRmMyiLk273ZarB6YIyYAKgAC8oAA2gBdfLhV0FpaO0ZcuQsLkXEDynSxqOgACa0HgoFwyFgLT0mH0U0q9sGglAAVM1ACiHHAQeBGgoAA7oIANagBnQSp8RAAT0VtueA2oyLoo03QgsLra1AANKBYCZfAARB+gj2rdbITbbUYAAwAEsgiBbKAAAk8xnms2CXLec73tuELhGB95fKE0DPl8TBXqMMyXAAhD+FzkmGR7ICeXIALLkLAsCmJBXK3rgC6gOh3whrKMagAAgqAACK8CmPoq63EYXhDhEnrep+1ARKQEagDKAA+iouO4njeL4JR6HgoThBSVJJvM5DvE0Xzsq4nKgFywTAP4qSYCKEkPA0TTpDmRnep83w4rWYDhvWsmRrGoAAGqAbYRCOaaLksNmbweV8oxYiwPkRv5vmBRxwVmsgXBdE8Q5DOMr7ghJH5fn6eyHMcwaEUQQA + tags: [] @@ -1265,11 +1321,12 @@ components: start: type: number description: The starting position of the text span. - example: 10 + examples: + - 10 length: type: number description: The length of the text span. - example: 5 + examples: [5] TextChange: type: object @@ -1279,7 +1336,7 @@ components: newText: type: string description: The new text to replace the span. - example: "Hello, world!" + examples: ["Hello, world!"] FileTextChanges: type: object @@ -1287,7 +1344,7 @@ components: fileName: type: string description: The name of the file to be changed. - example: "example.ts" + examples: ["example.ts"] textChanges: type: array items: @@ -1296,7 +1353,7 @@ components: isNewFile: type: boolean description: Indicates if the file is a new file. - example: true + examples: [true] CodeAction: type: object @@ -1304,7 +1361,7 @@ components: description: type: string description: Description of the code action to display in the UI of the editor. - example: "Fix formatting issues" + examples: ["Fix formatting issues"] changes: type: array items: @@ -1324,11 +1381,12 @@ components: type: integer compilerErrors: type: string - example: - error: "Uncaught Error" - message: "Errors were thrown in the sample, but not included in an errors tag" - errors: [7006] - compilerErrors: "index.ts [7006] 76 - Parameter 's' implicitly has an 'any' type." + examples: + - + error: "Uncaught Error" + message: "Errors were thrown in the sample, but not included in an errors tag" + errors: [7006] + compilerErrors: "index.ts [7006] 76 - Parameter 's' implicitly has an 'any' type." CompilerOptions: type: object @@ -1338,67 +1396,67 @@ components: description: | Allows importing TypeScript files with .ts extension. By enabling this option, TypeScript files with the `.ts` extension can be imported in the TypeScript project. By default, only files with the `.tsx` and `.d.ts` extensions are allowed to be imported. - example: true + examples: [true] allowJs: type: boolean description: | Allows JavaScript files to be included in the TypeScript project. When this option is enabled, JavaScript files (`.js`) can be included and compiled within the TypeScript project. This is useful for mixed JavaScript and TypeScript projects. - example: true + examples: [true] allowArbitraryExtensions: type: boolean description: | Allows importing files with arbitrary extensions. Enabling this option allows importing files with extensions that are not commonly associated with TypeScript or JavaScript, such as `.txt`, `.css`, or custom file extensions. It can be useful for special scenarios but should be used with caution. - example: false + examples: [false] allowSyntheticDefaultImports: type: boolean description: | Allows synthetic default imports for modules. Synthetic default imports enable importing modules that have a default export, even if the module itself doesn't explicitly define a default export. When enabled, TypeScript will attempt to generate an appropriate default import. This is useful when working with modules that don't provide a default export but are commonly consumed with default imports. - example: true + examples: [true] allowUmdGlobalAccess: type: boolean description: | Allows accessing UMD globals from modules. When using UMD modules, this option allows TypeScript to access global variables defined by UMD modules directly. UMD modules typically expose their functionality via global variables, and enabling this option makes those globals accessible from TypeScript code. - example: true + examples: [true] allowUnreachableCode: type: boolean description: | Allows unreachable code in the TypeScript project. By default, TypeScript flags unreachable code as an error. However, in certain cases, such as during development or debugging, it may be necessary to have unreachable code that is intentionally not executed. Enabling this option allows the presence of unreachable code without raising an error. - example: false + examples: [false] allowUnusedLabels: type: boolean description: | Allows unused labels in the TypeScript project. Labels in TypeScript are used to mark specific locations in the code for control flow purposes. By default, TypeScript raises an error when a label is declared but not used. Enabling this option allows the presence of unused labels without raising an error. - example: false + examples: [false] alwaysStrict: type: boolean description: | Enables strict mode for all files in the TypeScript project. Strict mode enforces stricter rules and more rigorous type checking in TypeScript. Enabling this option ensures that strict mode is applied to all files in the TypeScript project, regardless of whether they include a `"use strict"` directive or not. - example: true + examples: [true] baseUrl: type: string description: | Specifies the base directory for resolving non-relative module names. The `baseUrl` option is used to specify the base directory that TypeScript uses for resolving non-relative module names. When a module name is encountered that does not start with `./` or `../`, TypeScript will resolve the module path relative to the `baseUrl` directory. - example: "./src" + examples: ["./src"] charset: type: string description: | Specifies the character set of the input files. The `charset` option allows you to specify the character set encoding used for reading TypeScript source files. It is important to ensure that the specified character set matches the actual encoding of the source files to avoid potential parsing issues. - example: "utf-8" + examples: ["utf-8"] checkJs: type: boolean description: | Enables type checking for JavaScript files. By enabling the `checkJs` option, TypeScript will perform type checking on JavaScript files (`.js`). This can help catch type-related issues and provide better tooling support for JavaScript code within a TypeScript project. - example: true + examples: [true] customConditions: type: array items: @@ -1406,103 +1464,103 @@ components: description: | Specifies custom conditions for conditional type inclusion. Custom conditions are used in TypeScript's conditional types to control type inclusion based on specific conditions. This option allows you to specify custom conditions that can be used within your project's conditional types, providing flexibility in type checking and inference. - example: ["A", "B"] + examples: ["A", "B"] declaration: type: boolean description: | Generates corresponding .d.ts files for the TypeScript project. Enabling the `declaration` option instructs TypeScript to generate corresponding declaration files (`.d.ts`) alongside the emitted JavaScript files. Declaration files contain type information and enable better tooling support for using TypeScript code from other JavaScript projects. - example: true + examples: [true] declarationMap: type: boolean description: | Generates source maps for .d.ts files. When the `declarationMap` option is enabled, TypeScript will generate source maps for the declaration files (`.d.ts`). Source maps provide a mapping between the emitted JavaScript files and their corresponding TypeScript source files, allowing for improved debugging and tooling support. - example: true + examples: [true] emitDeclarationOnly: type: boolean description: | Only emits .d.ts files and not the compiled JavaScript files. When `emitDeclarationOnly` is enabled, TypeScript will only emit the declaration files (`.d.ts`) and skip emitting the compiled JavaScript files. This is useful when you only need the type information and don't require the compiled JavaScript output. - example: false + examples: [false] declarationDir: type: string description: | Specifies the output directory for .d.ts files. The `declarationDir` option allows you to specify the output directory for the generated declaration files (`.d.ts`). By default, declaration files are emitted alongside the corresponding JavaScript files. Use this option to customize the output directory for the declaration files. - example: "./dist/types" + examples: ["./dist/types"] disableSizeLimit: type: boolean description: | Disables the size limit imposed on JavaScript projects. By default, TypeScript imposes a size limit on JavaScript projects, and if the limit is exceeded, it raises an error. Enabling `disableSizeLimit` removes this size limit, allowing the compilation of larger JavaScript projects. However, it's important to ensure that the project's size is manageable and doesn't impact performance. - example: false + examples: [false] disableSourceOfProjectReferenceRedirect: type: boolean description: | Disables source file redirection in composite projects. TypeScript's composite projects allow splitting a large project into smaller sub-projects for incremental compilation. By default, composite projects redirect source files to their composite project's output directory. Enabling this option disables the source file redirection, preserving the original source file paths during compilation. - example: false + examples: [false] disableSolutionSearching: type: boolean description: | Disables searching for solutions in sibling directories. When resolving dependencies in a TypeScript project, TypeScript automatically searches for solution files (e.g., `tsconfig.json`) in the parent and sibling directories. Enabling `disableSolutionSearching` prevents TypeScript from searching for solutions in sibling directories, limiting the scope of project resolution. - example: false + examples: [false] disableReferencedProjectLoad: type: boolean description: | Disables loading referenced projects in TypeScript project references. TypeScript project references allow dividing a project into separate projects that can reference each other. By default, TypeScript loads the referenced projects during compilation. Enabling `disableReferencedProjectLoad` disables the automatic loading of referenced projects, requiring manual management of project dependencies. - example: false + examples: [false] downlevelIteration: type: boolean description: | Enables iteration of ES6 generators for downlevel iteration. ES6 generators introduce new iteration functionality. When targeting older ECMAScript versions, such as ES5, enabling `downlevelIteration` allows TypeScript to emit code that supports the iteration of ES6 generators in downlevel targets. This option is useful when targeting environments that don't natively support ES6 generators. - example: true + examples: [true] emitBOM: type: boolean description: | Specifies whether to emit a byte order mark (BOM) in emitted files. The byte order mark (BOM) is a Unicode character that serves as an indicator for the encoding of a text file. By default, TypeScript emits files without a BOM. Enabling `emitBOM` instructs TypeScript to include the BOM character at the beginning of emitted files, which can be useful for compatibility with certain tools and environments. - example: false + examples: [false] emitDecoratorMetadata: type: boolean description: | Enables emitting decorator metadata in TypeScript compiled output. Decorators are a TypeScript language feature used for adding metadata and modifying the behavior of classes, methods, properties, etc. Enabling `emitDecoratorMetadata` ensures that metadata associated with decorators is emitted in the compiled JavaScript output. This is required for certain frameworks or tools that rely on decorator metadata. - example: true + examples: [true] exactOptionalPropertyTypes: type: boolean description: | Enables strict checking of optional properties. By default, TypeScript allows assigning `null` or `undefined` to optional properties regardless of their declared type. Enabling `exactOptionalPropertyTypes` enforces strict checking for optional properties, ensuring that their types must match exactly, including `null` or `undefined`. - example: true + examples: [true] experimentalDecorators: type: boolean description: | Enables experimental support for ES7 decorators. Experimental decorators are a proposed feature of the ECMAScript standard (ES7) that TypeScript supports. Enabling `experimentalDecorators` allows you to use and experiment with decorators in your TypeScript code. It's important to note that experimental features may be subject to change or have limited compatibility. - example: true + examples: [true] forceConsistentCasingInFileNames: type: boolean description: | Forces consistent casing of referenced TypeScript files. The `forceConsistentCasingInFileNames` option enforces consistent casing for references to TypeScript files. When enabled, TypeScript checks that references to files in the code match the exact casing of the file names on disk. This helps avoid potential issues when working on case-sensitive file systems. - example: true + examples: [true] ignoreDeprecations: type: string description: | Specifies deprecation warnings to be ignored. TypeScript emits deprecation warnings when using deprecated features or APIs. The `ignoreDeprecations` option allows you to specify specific deprecation warnings to be ignored. Provide the deprecation warning message or code to suppress specific deprecation warnings during compilation. - example: "example-deprecation" + examples: ["example-deprecation"] importHelpers: type: boolean description: | Enables the import of helper functions from tslib. When working with certain language features or runtime helpers, TypeScript may emit additional helper functions to support the compilation output. Enabling `importHelpers` instructs TypeScript to import these helper functions from the `tslib` library instead of emitting them directly, resulting in smaller emitted JavaScript files. - example: true + examples: [true] importsNotUsedAsValues: $ref: "#/components/schemas/ImportsNotUsedAsValues" inlineSourceMap: @@ -1510,19 +1568,19 @@ components: description: | Specifies whether to inline source maps in emitted JavaScript files. Source maps provide a mapping between the emitted JavaScript files and their corresponding TypeScript source files, allowing for easier debugging. By default, TypeScript emits separate source map files. Enabling `inlineSourceMap` instructs TypeScript to include the source map content directly within the emitted JavaScript files, resulting in a single combined file. - example: false + examples: [false] inlineSources: type: boolean description: | Specifies whether to inline the original source code in emitted JavaScript files. When working with source maps, TypeScript can include the original TypeScript source code within the emitted JavaScript files. Enabling `inlineSources` instructs TypeScript to include the original source code inline, making it accessible within the emitted JavaScript files. This can be useful for debugging purposes. - example: false + examples: [false] isolatedModules: type: boolean description: | Enables each file to be treated as a separate module. By default, TypeScript treats all files within a project as part of the same module. Enabling `isolatedModules` instructs TypeScript to treat each file as a separate module, regardless of their dependencies or imports. This can be useful for projects where each file is independently executable or if you want to enforce strict module boundaries. - example: false + examples: [false] jsx: $ref: "#/components/schemas/JsxEmit" keyofStringsOnly: @@ -1530,7 +1588,7 @@ components: description: | Disallows symbols other than string in keyof. TypeScript's `keyof` operator allows you to obtain a union type representing the keys of a given object or type. By default, `keyof` includes all symbol types, including number and symbol keys. Enabling `keyofStringsOnly` restricts the keys to only string types, excluding number and symbol keys. - example: true + examples: [true] lib: type: array items: @@ -1538,25 +1596,25 @@ components: description: | Specifies the libraries to be included in the TypeScript project. TypeScript provides a set of pre-defined library files that include type definitions for common JavaScript APIs and runtime environments. The `lib` option allows you to specify the libraries to include in the TypeScript project. Available library options include `ES5`, `ES6`, `ES2015`, `DOM`, `DOM.Iterable`, `WebWorker`, and more. - example: ["ES2018", "DOM"] + examples: ["ES2018", "DOM"] locale: type: string description: | Specifies the locale to use for error messages. The `locale` option allows you to specify the locale to use for error messages and diagnostics. This affects the language used in error messages, type checking output, and other compiler diagnostics. Specify the locale using the BCP 47 language tag format, such as `"en-us"` for English (United States). - example: "en-us" + examples: ["en-us"] mapRoot: type: string description: | Specifies the location where debugger should locate map files. Source maps provide a mapping between the emitted JavaScript files and their corresponding TypeScript source files. The `mapRoot` option allows you to specify the location where the debugger should look for the source map files. Use this option when the source maps are hosted at a different location than the emitted JavaScript files. - example: "./maps" + examples: ["./maps"] maxNodeModuleJsDepth: type: number description: | Specifies the maximum folder depth for checking JavaScript files in node_modules. When resolving JavaScript files in the `node_modules` directory, TypeScript may encounter deeply nested files. The `maxNodeModuleJsDepth` option allows you to limit the folder depth TypeScript checks when looking for JavaScript files. Setting a value of `0` restricts the search to the top-level folder only. - example: 0 + examples: [0] module: $ref: "#/components/schemas/ModuleKind" moduleResolution: @@ -1568,7 +1626,7 @@ components: description: | Specifies the file suffixes to consider during module resolution. When resolving module imports, TypeScript considers files with specific suffixes. The `moduleSuffixes` option allows you to specify the file suffixes to consider during module resolution. By default, TypeScript considers files with `.ts`, `.tsx`, and `.js` extensions. Customize this option to include additional or different file suffixes as needed. - example: [".ts", ".tsx", ".js"] + examples: [".ts", ".tsx", ".js"] moduleDetection: $ref: "#/components/schemas/ModuleDetectionKind" newLine: @@ -1578,122 +1636,122 @@ components: description: | Disables emitting JavaScript files. Enabling the `noEmit` option instructs TypeScript not to emit any JavaScript files as output. This is useful when you only want to perform type checking and validation without generating compiled JavaScript files. Use this option during development or when TypeScript is used solely for static type checking. - example: false + examples: [false] noEmitHelpers: type: boolean description: | Disables generating custom helper functions in emitted JavaScript files. When targeting certain ECMAScript versions or using certain language features, TypeScript may emit additional helper functions to support the compiled JavaScript output. Enabling `noEmitHelpers` disables the generation of these custom helper functions, resulting in smaller emitted JavaScript files. - example: false + examples: [false] noEmitOnError: type: boolean description: | Disables emitting JavaScript files if any type errors are reported. By default, TypeScript emits JavaScript files even if there are type errors in the project. Enabling `noEmitOnError` instructs TypeScript to prevent emitting any JavaScript files if there are any reported type errors. This ensures that only error-free code is compiled and emitted. - example: true + examples: [true] noErrorTruncation: type: boolean description: | Disables truncating error messages. Error messages generated by TypeScript are often truncated to fit within a certain length limit. Enabling `noErrorTruncation` disables this truncation, allowing the full error messages to be displayed. This can be useful for detailed error analysis, but keep in mind that very long error messages may be harder to read. - example: false + examples: [false] noFallthroughCasesInSwitch: type: boolean description: | Disallows fallthrough cases in switch statements. TypeScript performs analysis on switch statements to detect fallthrough cases where one case does not include a `break` statement and execution continues into the next case. Enabling `noFallthroughCasesInSwitch` flags such cases as errors, ensuring that switch statements are handled correctly and explicitly in the code. - example: true + examples: [true] noImplicitAny: type: boolean description: | Disallows implicit `any` type declarations. By default, TypeScript allows implicit `any` types, where a variable or expression's type is automatically inferred as `any` when it is not explicitly annotated. Enabling `noImplicitAny` flags such cases as errors, requiring explicit type annotations to avoid relying on implicit `any` types. - example: true + examples: [true] noImplicitReturns: type: boolean description: | Disallows missing return types on function signatures. TypeScript checks for missing return types on function signatures and flags them as errors. Enabling `noImplicitReturns` ensures that all code paths within a function have a return statement or throw an error, avoiding potential logic errors or unintended control flow. - example: true + examples: [true] noImplicitThis: type: boolean description: | Disallows the use of `this` types without an explicit type annotation. In TypeScript, the `this` type is used to represent the type of the current object within a class or method. By default, TypeScript allows the use of `this` without an explicit type annotation. Enabling `noImplicitThis` flags such cases as errors, requiring explicit type annotations for `this` usage. - example: true + examples: [true] noStrictGenericChecks: type: boolean description: | Disables strict checking of generic signatures in TypeScript projects. Generics in TypeScript allow creating reusable functions or classes that can work with multiple types. Enabling `noStrictGenericChecks` relaxes the strict checking of generic signatures, allowing looser type inference and compatibility. However, it's important to note that stricter generic checks help ensure type safety and correctness. - example: false + examples: [false] noUnusedLocals: type: boolean description: | Disallows unused local variables. Unused local variables are variables declared within a function or block scope that are never referenced or used. Enabling `noUnusedLocals` flags such cases as errors, helping to identify and remove unused variables, which can improve code readability and maintainability. - example: true + examples: [true] noUnusedParameters: type: boolean description: | Disallows unused function parameters. Unused function parameters are parameters declared in function signatures that are never used or referenced within the function body. Enabling `noUnusedParameters` flags such cases as errors, encouraging the removal of unused parameters to improve code clarity and eliminate potential confusion. - example: true + examples: [true] noImplicitUseStrict: type: boolean description: | Disallows the use of implicit `use strict` directive. The `use strict` directive enables strict mode in JavaScript, which enforces stricter rules and eliminates certain language pitfalls. By default, TypeScript automatically adds the `use strict` directive to the emitted JavaScript files. Enabling `noImplicitUseStrict` disables the implicit insertion of `use strict`, allowing you to manually control its usage. - example: true + examples: [true] noPropertyAccessFromIndexSignature: type: boolean description: | Disallows accessing properties using the index signature notation. In TypeScript, objects can be accessed using property access notation (`obj.prop`) or index signature notation (`obj['prop']`). By default, TypeScript allows accessing properties using both notations. Enabling `noPropertyAccessFromIndexSignature` flags property access using index signature notation as errors, promoting consistent property access syntax. - example: false + examples: [false] assumeChangesOnlyAffectDirectDependencies: type: boolean description: | Instructs TypeScript to assume that changes only affect direct dependencies. The `assumeChangesOnlyAffectDirectDependencies` option is used in TypeScript's incremental compilation feature. When enabled, TypeScript assumes that changes made in the project only affect the directly dependent files, allowing for faster incremental builds. This option should be used with caution, as it may lead to incorrect compilation results if dependencies are not accurately tracked. - example: true + examples: [true] noLib: type: boolean description: | Disables including the default library file (lib.d.ts). By default, TypeScript includes the default library file (`lib.d.ts`) that provides type definitions for common JavaScript APIs and runtime environments. Enabling `noLib` instructs TypeScript not to include the default library file. This can be useful in specific scenarios where you want to provide your own custom library definitions. - example: false + examples: [false] noResolve: type: boolean description: | Disables automatic resolution of non-relative module names. TypeScript automatically resolves non-relative module names by searching for matching modules in various locations, such as `node_modules`. Enabling `noResolve` disables this automatic resolution, requiring all module names to be explicitly specified with a relative or absolute path. Use this option when you want full control over module resolution. - example: false + examples: [false] noUncheckedIndexedAccess: type: boolean description: | Disallows unchecked indexed access on possibly undefined values. By default, TypeScript allows indexing into possibly undefined values without checking for null or undefined. Enabling `noUncheckedIndexedAccess` flags such cases as errors, requiring explicit null or undefined checks before indexing into objects or arrays. This promotes safer coding practices and avoids potential runtime errors. - example: true + examples: [true] out: type: string description: | Specifies the single output file for the TypeScript project. The `out` option allows you to specify a single output file for the TypeScript project. When specified, TypeScript will concatenate and emit all compiled JavaScript files into the specified output file. Note that using `out` disables incremental compilation and should be used with caution for larger projects. - example: "./dist/bundle.js" + examples: ["./dist/bundle.js"] outDir: type: string description: | Specifies the output directory for emitted JavaScript files. The `outDir` option specifies the directory where TypeScript should emit the compiled JavaScript files. All emitted JavaScript files, including declaration files and source maps, will be placed in this directory. Use this option to control the location of the output files within your project's directory structure. - example: "./dist" + examples: ["./dist"] outFile: type: string description: | Specifies the single output file for the TypeScript project (alternative to `out`). The `outFile` option is an alternative to the `out` option for specifying a single output file for the TypeScript project. It functions in a similar way as `out`, but allows you to specify the output file directly within the `tsconfig.json` file. Note that using `outFile` disables incremental compilation and should be used with caution for larger projects. - example: "./dist/bundle.js" + examples: ["./dist/bundle.js"] paths: type: object additionalProperties: @@ -1703,105 +1761,106 @@ components: description: | Specifies path mappings for module resolution. The `paths` option allows you to specify path mappings for module resolution. This is particularly useful when working with module aliases or custom directory structures. Specify the module name or alias as the key and the corresponding path or pattern as the value in the `paths` object. - example: - "@utils/*": ["./src/utils/*"] - "@components/*": ["./src/components/*"] + examples: + - + "@utils/*": ["./src/utils/*"] + "@components/*": ["./src/components/*"] preserveConstEnums: type: boolean description: | Preserves const enums in the emitted JavaScript output. Const enums in TypeScript are enums that are fully inlined during compilation, resulting in more efficient JavaScript output. By default, TypeScript removes const enums during compilation to reduce the emitted code size. Enabling `preserveConstEnums` instructs TypeScript to preserve const enums in the emitted JavaScript output. - example: true + examples: [true] noImplicitOverride: type: boolean description: | Disallows explicit overriding of methods or properties. TypeScript allows explicit method or property overrides, where a derived class explicitly overrides a method or property from its base class. Enabling `noImplicitOverride` flags explicit overrides as errors, ensuring that methods or properties are properly overridden using the `override` keyword. - example: true + examples: [true] preserveSymlinks: type: boolean description: | Preserves symbolic links when resolving modules. By default, TypeScript follows symbolic links when resolving modules. Enabling `preserveSymlinks` instructs TypeScript to preserve symbolic links during module resolution. Use this option when you want TypeScript to treat symbolic links as separate entities and not follow them to their target locations. - example: false + examples: [false] preserveValueImports: type: boolean description: | Preserves unused values imported solely for their types. When importing modules in TypeScript, it is common to import certain values solely for their types, without actually using the imported values in the code. Enabling `preserveValueImports` ensures that these unused values are preserved during compilation, allowing TypeScript to retain their type information for better type checking and tooling support. - example: true + examples: [true] project: type: string description: | Specifies the path or file glob patterns for the TypeScript project. The `project` option specifies the path or file glob patterns for the TypeScript project configuration. It can be a path to a specific `tsconfig.json` file or a glob pattern matching multiple configuration files. When this option is provided, TypeScript will use the specified project configuration for compilation and other operations. - example: "./tsconfig.json" + examples: ["./tsconfig.json"] reactNamespace: type: string description: | Specifies the namespace for JSX factory and JSX fragment. When working with JSX in TypeScript, the `reactNamespace` option allows you to specify the namespace for the JSX factory and JSX fragment. By default, TypeScript uses `React` as the namespace. Use this option to customize the namespace based on your specific JSX implementation or library. - example: "React" + examples: ["React"] jsxFactory: type: string description: | Specifies the function to use as the JSX factory. The `jsxFactory` option specifies the function to use as the JSX factory. In JSX syntax, elements are transpiled into function calls, and the `jsxFactory` option determines the function to be used for creating these elements. Specify the function name or expression as the value of `jsxFactory`. - example: "h" + examples: ["h"] jsxFragmentFactory: type: string description: | Specifies the function to use as the JSX fragment factory. JSX fragments allow grouping multiple adjacent JSX elements without an enclosing wrapper element. The `jsxFragmentFactory` option specifies the function to use as the JSX fragment factory. Specify the function name or expression as the value of `jsxFragmentFactory`. This option is applicable when using JSX syntax. - example: "Fragment" + examples: ["Fragment"] jsxImportSource: type: string description: | Specifies the module to import JSX-related functions from. When using JSX syntax, TypeScript needs to import certain functions, such as the JSX factory or JSX fragment factory. The `jsxImportSource` option allows you to specify the module from which these JSX-related functions should be imported. Specify the module name or path as the value of `jsxImportSource`. - example: "preact" + examples: ["preact"] composite: type: boolean description: | Enables building TypeScript projects in composite mode. TypeScript's composite mode allows dividing a large project into separate sub-projects that can be built independently and incrementally. Enabling `composite` mode enables the use of project references and incremental compilation for faster builds. Use this option when working with complex or large-scale TypeScript projects. - example: true + examples: [true] incremental: type: boolean description: | Enables incremental compilation for TypeScript projects. Incremental compilation is a feature of TypeScript that allows recompiling only the necessary files when changes are made, resulting in faster builds. Enabling `incremental` mode enables the incremental compilation feature for the TypeScript project. This option is recommended for projects where build speed is a priority. - example: true + examples: [true] tsBuildInfoFile: type: string description: | Specifies the file to store incremental build information. Incremental compilation in TypeScript relies on storing build information for efficient recompilation. The `tsBuildInfoFile` option specifies the file where the incremental build information should be stored. This information is used to determine which files need to be recompiled when changes are made. - example: "./tsconfig.tsbuildinfo" + examples: ["./tsconfig.tsbuildinfo"] removeComments: type: boolean description: | Removes comments from the emitted JavaScript files. By default, TypeScript preserves comments from the source code in the emitted JavaScript files. Enabling `removeComments` instructs TypeScript to remove all comments during the compilation process, resulting in cleaner and more concise JavaScript output. - example: true + examples: [true] resolvePackageJsonExports: type: boolean description: | Enables resolving package.json exports field. Starting from ECMAScript modules (ESM) support in Node.js 12, the `exports` field in `package.json` files is used to define the exports of a module. Enabling `resolvePackageJsonExports` allows TypeScript to resolve module imports using the `exports` field in `package.json` files. Use this option when working with ESM and package exports. - example: true + examples: [true] resolvePackageJsonImports: type: boolean description: | Enables resolving imports from `package.json` files. TypeScript can resolve module imports directly from `package.json` files, bypassing the need for separate type declaration files (`*.d.ts`). Enabling `resolvePackageJsonImports` allows TypeScript to resolve imports using the `main` or `module` field in `package.json` files. This can simplify the import configuration for certain packages. - example: true + examples: [true] rootDir: type: string description: | Specifies the root directory of input files. The `rootDir` option specifies the root directory of input files in the TypeScript project. It is used to determine the relative path of each file within the project. This option is especially useful when working with projects that have a complex file structure or when using tools that rely on the project's root directory. - example: "./src" + examples: ["./src"] rootDirs: type: array items: @@ -1809,80 +1868,80 @@ components: description: | Specifies multiple root directories for the TypeScript project. The `rootDirs` option allows you to specify multiple root directories for the TypeScript project. When specified, TypeScript will consider all files within the specified root directories as part of the project. This can be useful when working with projects that span multiple directories or when using tools that require multiple root directories. - example: ["./src", "./tests"] + examples: ["./src", "./tests"] skipLibCheck: type: boolean description: | Skips type checking of declaration files in `node_modules`. By default, TypeScript performs type checking on declaration files (`*.d.ts`) in the `node_modules` directory. Enabling `skipLibCheck` skips the type checking of declaration files, which can significantly improve build performance, especially for large projects with many dependencies. - example: true + examples: [true] skipDefaultLibCheck: type: boolean description: | Skips type checking of default library file (lib.d.ts). The default library file (`lib.d.ts`) provides type definitions for common JavaScript APIs and runtime environments. Enabling `skipDefaultLibCheck` skips the type checking of the default library file. Use this option when you want to exclude the default library from type checking or when using alternative library files. - example: true + examples: [true] sourceMap: type: boolean description: | Specifies whether to generate source map files. Source maps provide a mapping between the emitted JavaScript files and their corresponding TypeScript source files, allowing for easier debugging. Enabling `sourceMap` instructs TypeScript to generate source map files along with the emitted JavaScript files. These source map files can be used by debuggers and other tools for source-level debugging. - example: true + examples: [true] sourceRoot: type: string description: | Specifies the location of the TypeScript source files. The `sourceRoot` option specifies the location of the TypeScript source files relative to the emitted JavaScript files. This option is used in the source maps to provide the correct path information for the TypeScript sources. It is especially useful when the TypeScript sources are located in a different directory from the emitted JavaScript files. - example: "./src" + examples: ["./src"] strict: type: boolean description: | Enables strict type checking options. The `strict` option enables a set of strict type checking options in TypeScript. Enabling `strict` is equivalent to enabling several individual strict options, including `strictNullChecks`, `strictFunctionTypes`, `strictBindCallApply`, `strictPropertyInitialization`, `noImplicitThis`, and more. Use this option to enforce strict type checking rules in your project. - example: true + examples: [true] strictFunctionTypes: type: boolean description: | Enables strict checking of function types. Function types in TypeScript include parameters and return types. By default, TypeScript allows for certain assignment compatibility between function types. Enabling `strictFunctionTypes` flags stricter checking of function types, ensuring that parameter types and return types must match exactly. - example: true + examples: [true] strictBindCallApply: type: boolean description: | Enables strict checking of `bind`, `call`, and `apply` methods. The `bind`, `call`, and `apply` methods in JavaScript allow for dynamic binding of functions and altering their execution context. Enabling `strictBindCallApply` enables strict checking of these methods, ensuring that the number of arguments and the types of arguments passed to these methods match the function's signature. - example: true + examples: [true] strictNullChecks: type: boolean description: | Enables strict null checking. Null and undefined are often sources of bugs in JavaScript. Enabling `strictNullChecks` enables strict checking for null and undefined values, preventing variables from being assigned null or undefined unless explicitly allowed. This option helps eliminate many common null-related errors. - example: true + examples: [true] strictPropertyInitialization: type: boolean description: | Enables strict checking of uninitialized class properties. Class properties in TypeScript can be initialized during declaration or within the constructor. Enabling `strictPropertyInitialization` flags uninitialized class properties as errors, ensuring that all class properties are explicitly initialized either during declaration or within the constructor. - example: true + examples: [true] stripInternal: type: boolean description: | Removes internal declaration files from the emitted JavaScript files. TypeScript includes internal declaration files that provide type information for the TypeScript language and compiler. Enabling `stripInternal` instructs TypeScript to remove these internal declaration files from the emitted JavaScript files. This can help reduce the size of the emitted JavaScript files, especially in production builds. - example: true + examples: [true] suppressExcessPropertyErrors: type: boolean description: | Suppresses excess property errors when assigning object literals. When assigning object literals to variables or parameters, TypeScript performs excess property checking to ensure that only known properties are assigned. Enabling `suppressExcessPropertyErrors` suppresses the excess property errors, allowing object literals to be assigned to variables or parameters without strict property checking. - example: true + examples: [true] suppressImplicitAnyIndexErrors: type: boolean description: | Suppresses implicit `any` errors for indexing objects. TypeScript performs implicit `any` checks when indexing into objects with arbitrary property names. Enabling `suppressImplicitAnyIndexErrors` suppresses the implicit `any` errors, allowing indexing into objects without strict type checking. Use this option when you need to work with objects that have dynamic or unknown property names. - example: true + examples: [true] target: $ref: "#/components/schemas/ScriptTarget" traceResolution: @@ -1890,19 +1949,19 @@ components: description: | Outputs detailed trace logs for module resolution. Enabling `traceResolution` outputs detailed trace logs during module resolution in TypeScript. These logs provide information about how TypeScript resolves module imports, including the paths searched, module resolutions, and more. Use this option for debugging or diagnosing module resolution issues in your project. - example: true + examples: [true] useUnknownInCatchVariables: type: boolean description: | Enables `unknown` type for catch clause variables. The `unknown` type in TypeScript represents values that are of an unknown type. Enabling `useUnknownInCatchVariables` allows catch clause variables to be typed as `unknown`, allowing more flexible handling of unknown error values in catch blocks. - example: true + examples: [true] resolveJsonModule: type: boolean description: | Enables importing JSON files as modules. Starting from ECMAScript modules (ESM) support in Node.js 10, JSON files can be imported as modules. Enabling `resolveJsonModule` allows TypeScript to import JSON files as modules, providing type checking and autocompletion for the imported JSON data. - example: true + examples: [true] types: type: array items: @@ -1910,7 +1969,7 @@ components: description: | Specifies the type declaration files to include. Type declaration files (`.d.ts`) provide type information for JavaScript libraries and modules. The `types` option allows you to specify the type declaration files to include in the TypeScript project. Specify the names of the desired type declaration files or packages as elements of the `types` array. - example: ["node", "jest"] + examples: ["node", "jest"] typeRoots: type: array items: @@ -1918,25 +1977,25 @@ components: description: | Specifies the locations to search for type declaration files. The `typeRoots` option specifies the locations to search for type declaration files (`.d.ts`). TypeScript searches these directories to find type declarations for installed packages and custom type definitions. Use this option to include additional directories containing type declaration files in your project. - example: ["./typings", "./custom-types"] + examples: ["./typings", "./custom-types"] verbatimModuleSyntax: type: boolean description: | Enables verbatim module syntax for CommonJS modules. CommonJS modules in TypeScript are transpiled into the CommonJS module format. Enabling `verbatimModuleSyntax` allows the emitted JavaScript output to use verbatim module syntax, preserving the original module import and export statements. This can be useful when interoperating with other tools or libraries that rely on the original CommonJS syntax. - example: true + examples: [true] esModuleInterop: type: boolean description: | Enables interoperability between CommonJS and ECMAScript modules. The `esModuleInterop` option enables interoperability between CommonJS modules and ECMAScript modules (ESM). When enabled, TypeScript generates code that allows importing ESM modules into CommonJS modules and vice versa, without the need for additional interop libraries or syntax transformations. - example: true + examples: [true] useDefineForClassFields: type: boolean description: | Uses the `defineProperty` method for class fields initialization. When initializing class fields in TypeScript, the default behavior is to assign the values directly to the instance. Enabling `useDefineForClassFields` uses the `defineProperty` method for initializing class fields. This can provide more fine-grained control over the initialization process and ensure consistency with the property accessors. - example: true + examples: [true] ImportsNotUsedAsValues: @@ -1948,7 +2007,7 @@ components: - `remove`: Removes unused imports that are not used as values. - `error`: Raises an error for unused imports that are not used as values. - `preserve`: Preserves all imports, even if they are not used as values. - example: "remove" + examples: ["remove"] JsxEmit: type: string @@ -1961,7 +2020,7 @@ components: - `react-jsxdev`: Emit JSX code with a ".js" file extension (development mode). - `preserve`: Preserve JSX code as part of the emitted JavaScript. - `react-native`: Emit JSX code compatible with React Native. - example: "react" + examples: ["react"] ModuleKind: type: string @@ -1969,7 +2028,7 @@ components: description: | Specifies the module code generation method. The `module` option specifies the module code generation method for the emitted JavaScript output. Different module formats are suitable for different runtime environments. Available options are: `none`, `commonjs`, `amd`, `system`, `umd`, `es2015`, `es2020`, `esnext`, and more. Choose the appropriate option based on your target environment and module loading system. - example: "commonjs" + examples: ["commonjs"] ModuleResolutionKind: type: string @@ -1977,7 +2036,7 @@ components: description: | Specifies the module resolution strategy. The `moduleResolution` option determines how TypeScript resolves module imports. Different module resolution strategies are suitable for different project structures and module loading systems. Available options are: `classic`, `node`, `node12`, and more. Choose the appropriate option based on your project's configuration and module resolution requirements. - example: "node" + examples: ["node"] ModuleDetectionKind: type: string @@ -1985,7 +2044,7 @@ components: description: | Specifies how modules are detected. The `moduleDetection` option determines how TypeScript detects and resolves modules. Different module detection methods have different behavior and compatibility. Available options are: `node`, `node12`, `modern`, `classic`, and more. Choose the appropriate option based on your project's configuration and module detection requirements. - example: "node" + examples: ["node"] NewLineKind: type: string @@ -1993,7 +2052,7 @@ components: description: | Specifies the end of line sequence to be used. The `newLine` option specifies the desired end-of-line (EOL) sequence to be used in the emitted JavaScript output. Available options are: `crlf` (carriage return + line feed) and `lf` (line feed). The chosen EOL sequence affects how lines are terminated in the emitted files. - example: "crlf" + examples: ["crlf"] ScriptTarget: type: string @@ -2001,6 +2060,6 @@ components: description: | Specifies the ECMAScript target version for emitted JavaScript files. The `target` option specifies the ECMAScript (ES) target version for the emitted JavaScript output. TypeScript provides support for different ECMAScript versions, such as `ES5`, `ES2015`, `ES2016`, `ES2017`, `ES2018`, `ES2019`, `ES2020`, `ESNext`, and more. Choose the appropriate target version based on your project's compatibility requirements. - example: "es2020" + examples: ["es2020"] \ No newline at end of file diff --git a/README.md b/README.md index e48e716..cfa7ba7 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,70 @@ +# ai-typescript-check -Partially modified version of @typescript/twoslash, Use an icon from the https://shikijs.github.io/twoslash/ webpage - -# deno-github-proxy -Allows for easy imports of ts files from GitHub while still keeping type inferencing. +Lint, auto-complete, error check, and type check typescript, jsx/tsx, and javascript files using an API. +Uses a partially modified version of [`@typescript/twoslash`](https://shikijs.github.io/twoslash/). Example usage in Deno ```ts -import * as neo4j from 'https://github-ts.okikio.workers.dev/neo4j/neo4j-javascript-driver/5.0/packages/neo4j-driver-deno/lib/mod.ts'; - -/** - * Create a new driver instance to connect to Neo4j - * @type {neo4j.Driver} - * @see https://neo4j.com/docs/api/javascript-driver/current/class/src/driver.js~Driver.html - * @see https://neo4j.com/docs/api/javascript-driver/current/global.html#Config - */ -const driver: neo4j.Driver = neo4j.driver( - Deno.env.get('NEO4J_URI') as string, - neo4j.auth.basic( - Deno.env.get('NEO4J_USERNAME') as string, - Deno.env.get('NEO4J_PASSWORD') as string - ) -); - -export default driver; +const formData = new FormData(); +formData.append("code", "import { hasTransferables } from \"transferables\"") +formData.append("extension", "ts"); + +const res = await fetch("https://ts-check.okikio.dev/twoslash", { + method: "POST", + body: formData +}) + +console.log({ + json: await res.json() +}) + +// OR + +const options = JSON.stringify({ + "code": "import { hasTransferables } from \"transferables\"", + "extension": "ts" +}); + +const res = await fetch(`https://ts-check.okikio.dev/twoslash?options=${options}`) + +console.log({ + json: await res.json() +}) ``` -> ^ You can also use this to fetch Javascript files but you'll need to add the `/?js` search query like so, https://github-ts.okikio.workers.dev/okikio/transferables/main/lib/index.mjs?js +Results + +```json +{ + "code": "import { hasTransferables } from \"transferables\"", + "extension": "ts", + "highlights": [], + "queries": [], + "staticQuickInfos": [ + { + "text": "(alias) function hasTransferables(obj: unknown, streams?: boolean, maxCount?: number): boolean\nimport hasTransferables", + "docs": "Quickly checks to see if input contains at least one transferable object, up to a max number of iterations\nThanks @aaorris for the help optimizing perf.", + "start": 9, + "length": 16, + "line": 0, + "character": 9, + "targetString": "hasTransferables" + } + ], + "errors": [], + "warnings": [ + { + "category": 2, + "code": 6133, + "length": 48, + "line": 0, + "character": 0, + "renderedMessage": "'hasTransferables' is declared but its value is never read.", + "id": "warn-6133-0-48" + } + ], + "playgroundURL": "https://www.typescriptlang.org/play/#code/JYWwDg9gTgLgBAbzgCwIYGcAqVUDt0BmApjgEYA2R6cAvnAVBCHAEQw77FmXotA", + "tags": [] +} +```