X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=.config%2Fcoc%2Fextensions%2Fnode_modules%2Fcoc-prettier%2Fnode_modules%2Fansi-escapes%2Fnode_modules%2Ftype-fest%2Fsource%2Freadonly-deep.d.ts;fp=.config%2Fcoc%2Fextensions%2Fnode_modules%2Fcoc-prettier%2Fnode_modules%2Fansi-escapes%2Fnode_modules%2Ftype-fest%2Fsource%2Freadonly-deep.d.ts;h=0000000000000000000000000000000000000000;hb=3ddadb3c98564791f0ac36cb39771d844a63dc91;hp=b8c04de25c2837e5314d63634e5e60c50c7b1b0b;hpb=5f797af6612ed10887189b47a1efc2f915586e59;p=dotfiles%2F.git diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/ansi-escapes/node_modules/type-fest/source/readonly-deep.d.ts b/.config/coc/extensions/node_modules/coc-prettier/node_modules/ansi-escapes/node_modules/type-fest/source/readonly-deep.d.ts deleted file mode 100644 index b8c04de2..00000000 --- a/.config/coc/extensions/node_modules/coc-prettier/node_modules/ansi-escapes/node_modules/type-fest/source/readonly-deep.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -import {Primitive} from './basic'; - -/** -Convert `object`s, `Map`s, `Set`s, and `Array`s and all of their keys/elements into immutable structures recursively. - -This is useful when a deeply nested structure needs to be exposed as completely immutable, for example, an imported JSON module or when receiving an API response that is passed around. - -Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/13923) if you want to have this type as a built-in in TypeScript. - -@example -``` -// data.json -{ - "foo": ["bar"] -} - -// main.ts -import {ReadonlyDeep} from 'type-fest'; -import dataJson = require('./data.json'); - -const data: ReadonlyDeep = dataJson; - -export default data; - -// test.ts -import data from './main'; - -data.foo.push('bar'); -//=> error TS2339: Property 'push' does not exist on type 'readonly string[]' -``` -*/ -export type ReadonlyDeep = T extends Primitive | ((...arguments: any[]) => unknown) - ? T - : T extends ReadonlyMap - ? ReadonlyMapDeep - : T extends ReadonlySet - ? ReadonlySetDeep - : T extends object - ? ReadonlyObjectDeep - : unknown; - -/** -Same as `ReadonlyDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `ReadonlyDeep`. -*/ -interface ReadonlyMapDeep - extends ReadonlyMap, ReadonlyDeep> {} - -/** -Same as `ReadonlyDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `ReadonlyDeep`. -*/ -interface ReadonlySetDeep - extends ReadonlySet> {} - -/** -Same as `ReadonlyDeep`, but accepts only `object`s as inputs. Internal helper for `ReadonlyDeep`. -*/ -type ReadonlyObjectDeep = { - readonly [KeyType in keyof ObjectType]: ReadonlyDeep -};