From 6b8bee7d0df2bfce9cab4ae59bb6b14f81d7a633 Mon Sep 17 00:00:00 2001 From: Ryan Sonshine Date: Wed, 19 May 2021 01:29:58 -0400 Subject: [PATCH] Add @category JSDoc tag to improve reference docs generation (#209) --- source/async-return-type.d.ts | 2 ++ source/asyncify.d.ts | 2 ++ source/basic.d.ts | 8 ++++++++ source/conditional-except.d.ts | 2 ++ source/conditional-keys.d.ts | 2 ++ source/conditional-pick.d.ts | 2 ++ source/entries.d.ts | 2 ++ source/entry.d.ts | 2 ++ source/except.d.ts | 2 ++ source/fixed-length-array.d.ts | 2 ++ source/iterable-element.d.ts | 2 ++ source/literal-union.d.ts | 2 ++ source/merge-exclusive.d.ts | 2 ++ source/merge.d.ts | 2 ++ source/mutable.d.ts | 2 ++ source/observable-like.d.ts | 2 ++ source/opaque.d.ts | 2 ++ source/package-json.d.ts | 2 ++ source/partial-deep.d.ts | 2 ++ source/primitive.d.ts | 2 ++ source/promisable.d.ts | 2 ++ source/promise-value.d.ts | 2 ++ source/readonly-deep.d.ts | 2 ++ source/require-at-least-one.d.ts | 2 ++ source/require-exactly-one.d.ts | 2 ++ source/set-optional.d.ts | 2 ++ source/set-required.d.ts | 2 ++ source/set-return-type.d.ts | 2 ++ source/stringified.d.ts | 2 ++ source/tsconfig-json.d.ts | 5 +++++ source/typed-array.d.ts | 2 ++ source/union-to-intersection.d.ts | 2 ++ source/value-of.d.ts | 2 ++ ts41/camel-case.d.ts | 2 ++ ts41/camel-cased-properties-deep.d.ts | 2 ++ ts41/camel-cased-properties.d.ts | 2 ++ ts41/delimiter-case.d.ts | 5 ++++- ts41/delimiter-cased-properties-deep.d.ts | 2 ++ ts41/delimiter-cased-properties.d.ts | 2 ++ ts41/get.d.ts | 2 ++ ts41/kebab-case.d.ts | 3 ++- ts41/kebab-cased-properties-deep.d.ts | 2 ++ ts41/kebab-cased-properties.d.ts | 2 ++ ts41/last-array-element.d.ts | 2 ++ ts41/pascal-case.d.ts | 3 ++- ts41/pascal-cased-properties-deep.d.ts | 2 ++ ts41/pascal-cased-properties.d.ts | 2 ++ ts41/snake-case.d.ts | 2 ++ ts41/snake-cased-properties-deep.d.ts | 2 ++ ts41/snake-cased-properties.d.ts | 2 ++ ts41/split.d.ts | 2 ++ ts41/trim.d.ts | 2 ++ 52 files changed, 115 insertions(+), 3 deletions(-) diff --git a/source/async-return-type.d.ts b/source/async-return-type.d.ts index 79ec1e961..1f2c46aaa 100644 --- a/source/async-return-type.d.ts +++ b/source/async-return-type.d.ts @@ -19,5 +19,7 @@ async function doSomething(value: Value) {} asyncFunction().then(value => doSomething(value)); ``` + +@category Utilities */ export type AsyncReturnType = PromiseValue>; diff --git a/source/asyncify.d.ts b/source/asyncify.d.ts index 455f2ebda..e88d99053 100644 --- a/source/asyncify.d.ts +++ b/source/asyncify.d.ts @@ -27,5 +27,7 @@ const getFooAsync: AsyncifiedFooGetter = (someArg) => { // … } ``` + +@category Utilities */ export type Asyncify any> = SetReturnType>>>; diff --git a/source/basic.d.ts b/source/basic.d.ts index 67a5fa642..322aa0ad9 100644 --- a/source/basic.d.ts +++ b/source/basic.d.ts @@ -1,6 +1,8 @@ // TODO: Remove the `= unknown` sometime in the future when most users are on TS 3.5 as it's now the default /** Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes). + +@category Basic */ export type Class = new(...arguments_: Arguments) => T; @@ -8,11 +10,15 @@ export type Class = new(...argumen Matches a JSON object. This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`. + +@category Basic */ export type JsonObject = {[Key in string]?: JsonValue}; /** Matches a JSON array. + +@category Basic */ export interface JsonArray extends Array {} // TODO: Make it this when targeting TypeScript 4.1: @@ -20,5 +26,7 @@ export interface JsonArray extends Array {} /** Matches any valid JSON value. + +@category Basic */ export type JsonValue = string | number | boolean | null | JsonObject | JsonArray; diff --git a/source/conditional-except.d.ts b/source/conditional-except.d.ts index ac506ccf1..79295aea8 100644 --- a/source/conditional-except.d.ts +++ b/source/conditional-except.d.ts @@ -36,6 +36,8 @@ interface Example { type NonStringKeysOnly = ConditionalExcept; //=> {b: string | number; c: () => void; d: {}} ``` + +@category Utilities */ export type ConditionalExcept = Except< Base, diff --git a/source/conditional-keys.d.ts b/source/conditional-keys.d.ts index eb074dc5d..a422fd83a 100644 --- a/source/conditional-keys.d.ts +++ b/source/conditional-keys.d.ts @@ -25,6 +25,8 @@ To support partial types, make sure your `Condition` is a union of undefined (fo type StringKeysAndUndefined = ConditionalKeys; //=> 'a' | 'c' ``` + +@category Utilities */ export type ConditionalKeys = NonNullable< // Wrap in `NonNullable` to strip away the `undefined` type from the produced union. diff --git a/source/conditional-pick.d.ts b/source/conditional-pick.d.ts index cecc3df14..5e1472a2e 100644 --- a/source/conditional-pick.d.ts +++ b/source/conditional-pick.d.ts @@ -35,6 +35,8 @@ interface Example { type StringKeysOnly = ConditionalPick; //=> {a: string} ``` + +@category Utilities */ export type ConditionalPick = Pick< Base, diff --git a/source/entries.d.ts b/source/entries.d.ts index e02237a92..a48fa1e03 100644 --- a/source/entries.d.ts +++ b/source/entries.d.ts @@ -48,6 +48,8 @@ const mapEntries: Entries = [['a', 1]]; const setExample = new Set(['a', 1]); const setEntries: Entries = [['a', 'a'], [1, 1]]; ``` + +@category Utilities */ export type Entries = BaseType extends Map ? MapEntries diff --git a/source/entry.d.ts b/source/entry.d.ts index db718216a..869e51e62 100644 --- a/source/entry.d.ts +++ b/source/entry.d.ts @@ -51,6 +51,8 @@ const setExample = new Set(['a', 1]); const setEntryString: Entry = ['a', 'a']; const setEntryNumber: Entry = [1, 1]; ``` + +@category Utilities */ export type Entry = BaseType extends Map ? MapEntry diff --git a/source/except.d.ts b/source/except.d.ts index 871e661c0..ad542580c 100644 --- a/source/except.d.ts +++ b/source/except.d.ts @@ -18,5 +18,7 @@ type Foo = { type FooWithoutA = Except; //=> {b: string}; ``` + +@category Utilities */ export type Except = Pick>; diff --git a/source/fixed-length-array.d.ts b/source/fixed-length-array.d.ts index e3bc0f473..e7711e479 100644 --- a/source/fixed-length-array.d.ts +++ b/source/fixed-length-array.d.ts @@ -27,6 +27,8 @@ const homeFencingTeam: FencingTeam = ['George', 'John']; guestFencingTeam.push('Sam'); //=> error TS2339: Property 'push' does not exist on type 'FencingTeam' ``` + +@category Utilities */ export type FixedLengthArray = Pick< ArrayPrototype, diff --git a/source/iterable-element.d.ts b/source/iterable-element.d.ts index 174cfbf4b..f53a3f5d0 100644 --- a/source/iterable-element.d.ts +++ b/source/iterable-element.d.ts @@ -37,6 +37,8 @@ An example with an array of strings: ``` type MeString = IterableElement ``` + +@category Utilities */ export type IterableElement = TargetIterable extends Iterable ? diff --git a/source/literal-union.d.ts b/source/literal-union.d.ts index fed4ddbcf..3544bf66c 100644 --- a/source/literal-union.d.ts +++ b/source/literal-union.d.ts @@ -26,6 +26,8 @@ type Pet2 = LiteralUnion<'dog' | 'cat', string>; const pet: Pet2 = ''; // You **will** get auto-completion for `dog` and `cat` literals. ``` + +@category Utilities */ export type LiteralUnion< LiteralType, diff --git a/source/merge-exclusive.d.ts b/source/merge-exclusive.d.ts index 059bd2cbe..47d922144 100644 --- a/source/merge-exclusive.d.ts +++ b/source/merge-exclusive.d.ts @@ -31,6 +31,8 @@ exclusiveOptions = {exclusive2: 'hi'}; exclusiveOptions = {exclusive1: true, exclusive2: 'hi'}; //=> Error ``` + +@category Utilities */ export type MergeExclusive = (FirstType | SecondType) extends object ? diff --git a/source/merge.d.ts b/source/merge.d.ts index 695cb9530..d6371f1b6 100644 --- a/source/merge.d.ts +++ b/source/merge.d.ts @@ -21,5 +21,7 @@ type Bar = { const ab: Merge = {a: 1, b: 2}; ``` + +@category Utilities */ export type Merge = Simplify>; diff --git a/source/mutable.d.ts b/source/mutable.d.ts index a465d4132..cd1042dae 100644 --- a/source/mutable.d.ts +++ b/source/mutable.d.ts @@ -28,6 +28,8 @@ type SomeMutable = Mutable; // c: boolean; // It's now mutable. // } ``` + +@category Utilities */ export type Mutable = Simplify< diff --git a/source/observable-like.d.ts b/source/observable-like.d.ts index bba62f14a..9b2e35b3b 100644 --- a/source/observable-like.d.ts +++ b/source/observable-like.d.ts @@ -6,6 +6,8 @@ declare global { /** Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable). + +@category Basic */ export interface ObservableLike { subscribe(observer: (value: unknown) => void): void; diff --git a/source/opaque.d.ts b/source/opaque.d.ts index 20ab964e2..f22cb248a 100644 --- a/source/opaque.d.ts +++ b/source/opaque.d.ts @@ -61,5 +61,7 @@ type Person = { name: string; }; ``` + +@category Utilities */ export type Opaque = Type & {readonly __opaque__: Token}; diff --git a/source/package-json.d.ts b/source/package-json.d.ts index 953f4d42d..ffd721df0 100644 --- a/source/package-json.d.ts +++ b/source/package-json.d.ts @@ -629,6 +629,8 @@ declare namespace PackageJson { /** Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Also includes types for fields used by other popular projects, like TypeScript and Yarn. + +@category Miscellaneous */ export type PackageJson = PackageJson.PackageJsonStandard & diff --git a/source/partial-deep.d.ts b/source/partial-deep.d.ts index 2bc6cd7e0..572b77cab 100644 --- a/source/partial-deep.d.ts +++ b/source/partial-deep.d.ts @@ -27,6 +27,8 @@ const applySavedSettings = (savedSettings: PartialDeep) => { settings = applySavedSettings({textEditor: {fontWeight: 500}}); ``` + +@category Utilities */ export type PartialDeep = T extends Primitive ? Partial diff --git a/source/primitive.d.ts b/source/primitive.d.ts index 35d0f7556..5ad7a0b89 100644 --- a/source/primitive.d.ts +++ b/source/primitive.d.ts @@ -1,5 +1,7 @@ /** Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). + +@category Basic */ export type Primitive = | null diff --git a/source/promisable.d.ts b/source/promisable.d.ts index 71242a5db..e26395931 100644 --- a/source/promisable.d.ts +++ b/source/promisable.d.ts @@ -18,6 +18,8 @@ async function logger(getLogEntry: () => Promisable): Promise { logger(() => 'foo'); logger(() => Promise.resolve('bar')); + +@category Utilities ``` */ export type Promisable = T | PromiseLike; diff --git a/source/promise-value.d.ts b/source/promise-value.d.ts index 642ddebcc..b81e31fca 100644 --- a/source/promise-value.d.ts +++ b/source/promise-value.d.ts @@ -21,6 +21,8 @@ let syncData: SyncData = getSyncData(); type RecursiveAsyncData = Promise >; let recursiveAsyncData: PromiseValue = Promise.resolve(Promise.resolve('ABC')); ``` + +@category Utilities */ export type PromiseValue = PromiseType extends Promise ? { 0: PromiseValue; 1: Value }[PromiseType extends Promise ? 0 : 1] diff --git a/source/readonly-deep.d.ts b/source/readonly-deep.d.ts index f0b691f84..e70cf7291 100644 --- a/source/readonly-deep.d.ts +++ b/source/readonly-deep.d.ts @@ -28,6 +28,8 @@ import data from './main'; data.foo.push('bar'); //=> error TS2339: Property 'push' does not exist on type 'readonly string[]' ``` + +@category Utilities */ export type ReadonlyDeep = T extends Primitive | ((...arguments: any[]) => unknown) ? T diff --git a/source/require-at-least-one.d.ts b/source/require-at-least-one.d.ts index b3b871917..59a06dcc3 100644 --- a/source/require-at-least-one.d.ts +++ b/source/require-at-least-one.d.ts @@ -19,6 +19,8 @@ const responder: RequireAtLeastOne = { secure: true }; ``` + +@category Utilities */ export type RequireAtLeastOne< ObjectType, diff --git a/source/require-exactly-one.d.ts b/source/require-exactly-one.d.ts index c3e7e7ead..fc01aecc9 100644 --- a/source/require-exactly-one.d.ts +++ b/source/require-exactly-one.d.ts @@ -27,6 +27,8 @@ const responder: RequireExactlyOne = { secure: true }; ``` + +@category Utilities */ export type RequireExactlyOne = {[Key in KeysType]: ( diff --git a/source/set-optional.d.ts b/source/set-optional.d.ts index ebaf09819..32604ce0a 100644 --- a/source/set-optional.d.ts +++ b/source/set-optional.d.ts @@ -23,6 +23,8 @@ type SomeOptional = SetOptional; // c?: boolean; // Is now optional. // } ``` + +@category Utilities */ export type SetOptional = Simplify< diff --git a/source/set-required.d.ts b/source/set-required.d.ts index ab8593eb5..7f25da657 100644 --- a/source/set-required.d.ts +++ b/source/set-required.d.ts @@ -23,6 +23,8 @@ type SomeRequired = SetRequired; // c: boolean; // Is now required. // } ``` + +@category Utilities */ export type SetRequired = Simplify< diff --git a/source/set-return-type.d.ts b/source/set-return-type.d.ts index 98766b103..6d198d0a9 100644 --- a/source/set-return-type.d.ts +++ b/source/set-return-type.d.ts @@ -16,6 +16,8 @@ type MyFunctionThatCanThrow = (foo: SomeType, bar: unknown) => SomeOtherType; type MyWrappedFunction = SetReturnType; //=> type MyWrappedFunction = (foo: SomeType, bar: unknown) => SomeOtherType | undefined; ``` + +@category Utilities */ export type SetReturnType any, TypeToReturn> = // Just using `Parameters` isn't ideal because it doesn't handle the `this` fake parameter. diff --git a/source/stringified.d.ts b/source/stringified.d.ts index 9688b6740..308733109 100644 --- a/source/stringified.d.ts +++ b/source/stringified.d.ts @@ -17,5 +17,7 @@ const carForm: Stringified = { speed: '101' }; ``` + +@category Utilities */ export type Stringified = {[KeyType in keyof ObjectType]: string}; diff --git a/source/tsconfig-json.d.ts b/source/tsconfig-json.d.ts index 89f6e9dd4..57f5a45eb 100644 --- a/source/tsconfig-json.d.ts +++ b/source/tsconfig-json.d.ts @@ -815,6 +815,11 @@ declare namespace TsConfigJson { } } +/** +Type for [TypeScript's `tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) (TypeScript 3.7). + +@category Miscellaneous +*/ export interface TsConfigJson { /** Instructs the TypeScript compiler how to compile `.ts` files. diff --git a/source/typed-array.d.ts b/source/typed-array.d.ts index d4855ae48..a6a1d92fc 100644 --- a/source/typed-array.d.ts +++ b/source/typed-array.d.ts @@ -2,6 +2,8 @@ /** Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`. + +@category Basic */ export type TypedArray = | Int8Array diff --git a/source/union-to-intersection.d.ts b/source/union-to-intersection.d.ts index 5f9837f3b..4c1d94bc6 100644 --- a/source/union-to-intersection.d.ts +++ b/source/union-to-intersection.d.ts @@ -40,6 +40,8 @@ type Union = typeof union; type Intersection = UnionToIntersection; //=> {a1(): void; b1(): void; a2(argA: string): void; b2(argB: string): void} ``` + +@category Utilities */ export type UnionToIntersection = ( // `extends unknown` is always going to be the case and is used to convert the diff --git a/source/value-of.d.ts b/source/value-of.d.ts index 12793733b..a5c696bdd 100644 --- a/source/value-of.d.ts +++ b/source/value-of.d.ts @@ -36,5 +36,7 @@ onlyBar('foo'); onlyBar('bar'); //=> 2 ``` + +@category Utilities */ export type ValueOf = ObjectType[ValueType]; diff --git a/ts41/camel-case.d.ts b/ts41/camel-case.d.ts index 7135743d9..e391559cd 100644 --- a/ts41/camel-case.d.ts +++ b/ts41/camel-case.d.ts @@ -60,5 +60,7 @@ const dbResult: CamelCasedProperties = { foo: 123 }; ``` + +@category Template Literals */ export type CamelCase = K extends string ? CamelCaseStringArray> : K; diff --git a/ts41/camel-cased-properties-deep.d.ts b/ts41/camel-cased-properties-deep.d.ts index 7117a75b4..015057e9e 100644 --- a/ts41/camel-cased-properties-deep.d.ts +++ b/ts41/camel-cased-properties-deep.d.ts @@ -37,6 +37,8 @@ const result: CamelCasedPropertiesDeep = { ], }; ``` + +@category Template Literals */ export type CamelCasedPropertiesDeep = Value extends Function ? Value diff --git a/ts41/camel-cased-properties.d.ts b/ts41/camel-cased-properties.d.ts index ca315952c..8bbb53c1f 100644 --- a/ts41/camel-cased-properties.d.ts +++ b/ts41/camel-cased-properties.d.ts @@ -20,6 +20,8 @@ const result: CamelCasedProperties = { userName: 'Tom', }; ``` + +@category Template Literals */ export type CamelCasedProperties = Value extends Function ? Value diff --git a/ts41/delimiter-case.d.ts b/ts41/delimiter-case.d.ts index a58ed5526..ea15bd32f 100644 --- a/ts41/delimiter-case.d.ts +++ b/ts41/delimiter-case.d.ts @@ -2,6 +2,8 @@ import {UpperCaseCharacters, WordSeparators} from '../source/utilities'; /** Unlike a simpler split, this one includes the delimiter splitted on in the resulting array literal. This is to enable splitting on, for example, upper-case characters. + +@category Template Literals */ export type SplitIncludingDelimiters = Source extends '' ? [] : @@ -73,8 +75,9 @@ const rawCliOptions: OddlyCasedProperties = { foo: 123 }; ``` -*/ +@category Template Literals +*/ export type DelimiterCase = Value extends string ? StringArrayToDelimiterCase< SplitIncludingDelimiters, diff --git a/ts41/delimiter-cased-properties-deep.d.ts b/ts41/delimiter-cased-properties-deep.d.ts index 741c4ad8a..f8589462c 100644 --- a/ts41/delimiter-cased-properties-deep.d.ts +++ b/ts41/delimiter-cased-properties-deep.d.ts @@ -37,6 +37,8 @@ const result: DelimiterCasedPropertiesDeep = { ], }; ``` + +@category Template Literals */ export type DelimiterCasedPropertiesDeep< Value, diff --git a/ts41/delimiter-cased-properties.d.ts b/ts41/delimiter-cased-properties.d.ts index 8a108a665..a4c89b092 100644 --- a/ts41/delimiter-cased-properties.d.ts +++ b/ts41/delimiter-cased-properties.d.ts @@ -20,6 +20,8 @@ const result: DelimiterCasedProperties = { 'user-name': 'Tom', }; ``` + +@category Template Literals */ export type DelimiterCasedProperties< Value, diff --git a/ts41/get.d.ts b/ts41/get.d.ts index 9103e9aa3..1b91a7d16 100644 --- a/ts41/get.d.ts +++ b/ts41/get.d.ts @@ -127,5 +127,7 @@ const getName = (apiResponse: ApiResponse) => get(apiResponse, 'hits.hits[0]._source.name'); //=> Array<{given: string[]; family: string}> ``` + +@category Template Literals */ export type Get = GetWithPath>; diff --git a/ts41/kebab-case.d.ts b/ts41/kebab-case.d.ts index 47049c779..b3185c125 100644 --- a/ts41/kebab-case.d.ts +++ b/ts41/kebab-case.d.ts @@ -31,6 +31,7 @@ const rawCliOptions: KebabCasedProperties = { foo: 123 }; ``` -*/ +@category Template Literals +*/ export type KebabCase = DelimiterCase; diff --git a/ts41/kebab-cased-properties-deep.d.ts b/ts41/kebab-cased-properties-deep.d.ts index cdca49945..e7af08506 100644 --- a/ts41/kebab-cased-properties-deep.d.ts +++ b/ts41/kebab-cased-properties-deep.d.ts @@ -37,5 +37,7 @@ const result: KebabCasedPropertiesDeep = { ], }; ``` + +@category Template Literals */ export type KebabCasedPropertiesDeep = DelimiterCasedPropertiesDeep; diff --git a/ts41/kebab-cased-properties.d.ts b/ts41/kebab-cased-properties.d.ts index 950cda5f7..2529d76be 100644 --- a/ts41/kebab-cased-properties.d.ts +++ b/ts41/kebab-cased-properties.d.ts @@ -20,5 +20,7 @@ const result: KebabCasedProperties = { 'user-name': 'Tom', }; ``` + +@category Template Literals */ export type KebabCasedProperties = DelimiterCasedProperties; diff --git a/ts41/last-array-element.d.ts b/ts41/last-array-element.d.ts index 01de4de36..d181be733 100644 --- a/ts41/last-array-element.d.ts +++ b/ts41/last-array-element.d.ts @@ -14,6 +14,8 @@ const array = ['foo', 2]; typeof lastOf(array); //=> number ``` + +@category Template Literals */ export type LastArrayElement = ValueType extends [infer ElementType] diff --git a/ts41/pascal-case.d.ts b/ts41/pascal-case.d.ts index 35bd2fd18..518cc6b44 100644 --- a/ts41/pascal-case.d.ts +++ b/ts41/pascal-case.d.ts @@ -29,8 +29,9 @@ const dbResult: CamelCasedProperties = { Foo: 123 }; ``` -*/ +@category Template Literals +*/ export type PascalCase = CamelCase extends string ? Capitalize> : CamelCase; diff --git a/ts41/pascal-cased-properties-deep.d.ts b/ts41/pascal-cased-properties-deep.d.ts index 6bcb9569e..87c02f33e 100644 --- a/ts41/pascal-cased-properties-deep.d.ts +++ b/ts41/pascal-cased-properties-deep.d.ts @@ -37,6 +37,8 @@ const result: PascalCasedPropertiesDeep = { ], }; ``` + +@category Template Literals */ export type PascalCasedPropertiesDeep = Value extends Function ? Value diff --git a/ts41/pascal-cased-properties.d.ts b/ts41/pascal-cased-properties.d.ts index f4f8394e3..14bae5e7b 100644 --- a/ts41/pascal-cased-properties.d.ts +++ b/ts41/pascal-cased-properties.d.ts @@ -20,6 +20,8 @@ const result: PascalCasedProperties = { UserName: 'Tom', }; ``` + +@category Template Literals */ export type PascalCasedProperties = Value extends Function ? Value diff --git a/ts41/snake-case.d.ts b/ts41/snake-case.d.ts index f8efb4bd5..851d43fcc 100644 --- a/ts41/snake-case.d.ts +++ b/ts41/snake-case.d.ts @@ -31,5 +31,7 @@ const dbResult: SnakeCasedProperties = { foo: 123 }; ``` + +@category Template Literals */ export type SnakeCase = DelimiterCase; diff --git a/ts41/snake-cased-properties-deep.d.ts b/ts41/snake-cased-properties-deep.d.ts index fb822a51e..7133a0f15 100644 --- a/ts41/snake-cased-properties-deep.d.ts +++ b/ts41/snake-cased-properties-deep.d.ts @@ -37,5 +37,7 @@ const result: SnakeCasedPropertiesDeep = { ], }; ``` + +@category Template Literals */ export type SnakeCasedPropertiesDeep = DelimiterCasedPropertiesDeep; diff --git a/ts41/snake-cased-properties.d.ts b/ts41/snake-cased-properties.d.ts index 6305ba894..fc3011ea8 100644 --- a/ts41/snake-cased-properties.d.ts +++ b/ts41/snake-cased-properties.d.ts @@ -20,5 +20,7 @@ const result: SnakeCasedProperties = { user_name: 'Tom', }; ``` + +@category Template Literals */ export type SnakeCasedProperties = DelimiterCasedProperties; diff --git a/ts41/split.d.ts b/ts41/split.d.ts index 36e541a23..f68124a34 100644 --- a/ts41/split.d.ts +++ b/ts41/split.d.ts @@ -15,6 +15,8 @@ let array: Item[]; array = split(items, ','); ``` + +@category Template Literals */ export type Split = S extends `${infer T}${D}${infer U}` diff --git a/ts41/trim.d.ts b/ts41/trim.d.ts index d1c33cdcc..a226cf266 100644 --- a/ts41/trim.d.ts +++ b/ts41/trim.d.ts @@ -18,5 +18,7 @@ import {Trim} from 'type-fest'; Trim<' foo '> //=> 'foo' ``` + +@category Template Literals */ export type Trim = TrimLeft>;