Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

index.d.ts 5.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /// <reference types="node" />
  2. /// <reference lib="es2016" />
  3. /// <reference lib="es2017.sharedmemory" />
  4. /// <reference lib="esnext.asynciterable" />
  5. /// <reference lib="dom" />
  6. declare type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
  7. declare type Primitive = null | undefined | string | number | boolean | Symbol;
  8. export interface ArrayLike {
  9. length: number;
  10. }
  11. export interface Class<T = unknown> {
  12. new (...args: any[]): T;
  13. }
  14. declare type DomElement = object & {
  15. nodeType: 1;
  16. nodeName: string;
  17. };
  18. declare type NodeStream = object & {
  19. pipe: Function;
  20. };
  21. export declare const enum TypeName {
  22. null = "null",
  23. boolean = "boolean",
  24. undefined = "undefined",
  25. string = "string",
  26. number = "number",
  27. symbol = "symbol",
  28. Function = "Function",
  29. GeneratorFunction = "GeneratorFunction",
  30. AsyncFunction = "AsyncFunction",
  31. Observable = "Observable",
  32. Array = "Array",
  33. Buffer = "Buffer",
  34. Object = "Object",
  35. RegExp = "RegExp",
  36. Date = "Date",
  37. Error = "Error",
  38. Map = "Map",
  39. Set = "Set",
  40. WeakMap = "WeakMap",
  41. WeakSet = "WeakSet",
  42. Int8Array = "Int8Array",
  43. Uint8Array = "Uint8Array",
  44. Uint8ClampedArray = "Uint8ClampedArray",
  45. Int16Array = "Int16Array",
  46. Uint16Array = "Uint16Array",
  47. Int32Array = "Int32Array",
  48. Uint32Array = "Uint32Array",
  49. Float32Array = "Float32Array",
  50. Float64Array = "Float64Array",
  51. ArrayBuffer = "ArrayBuffer",
  52. SharedArrayBuffer = "SharedArrayBuffer",
  53. DataView = "DataView",
  54. Promise = "Promise",
  55. URL = "URL"
  56. }
  57. declare function is(value: unknown): TypeName;
  58. declare namespace is {
  59. const undefined: (value: unknown) => value is undefined;
  60. const string: (value: unknown) => value is string;
  61. const number: (value: unknown) => value is number;
  62. const function_: (value: unknown) => value is Function;
  63. const null_: (value: unknown) => value is null;
  64. const class_: (value: unknown) => value is Class<unknown>;
  65. const boolean: (value: unknown) => value is boolean;
  66. const symbol: (value: unknown) => value is Symbol;
  67. const numericString: (value: unknown) => boolean;
  68. const array: (arg: any) => arg is any[];
  69. const buffer: (input: unknown) => input is Buffer;
  70. const nullOrUndefined: (value: unknown) => value is null | undefined;
  71. const object: (value: unknown) => value is object;
  72. const iterable: (value: unknown) => value is IterableIterator<unknown>;
  73. const asyncIterable: (value: unknown) => value is AsyncIterableIterator<unknown>;
  74. const generator: (value: unknown) => value is Generator;
  75. const nativePromise: (value: unknown) => value is Promise<unknown>;
  76. const promise: (value: unknown) => value is Promise<unknown>;
  77. const generatorFunction: (value: unknown) => value is GeneratorFunction;
  78. const asyncFunction: (value: unknown) => value is Function;
  79. const boundFunction: (value: unknown) => value is Function;
  80. const regExp: (value: unknown) => value is RegExp;
  81. const date: (value: unknown) => value is Date;
  82. const error: (value: unknown) => value is Error;
  83. const map: (value: unknown) => value is Map<unknown, unknown>;
  84. const set: (value: unknown) => value is Set<unknown>;
  85. const weakMap: (value: unknown) => value is WeakMap<object, unknown>;
  86. const weakSet: (value: unknown) => value is WeakSet<object>;
  87. const int8Array: (value: unknown) => value is Int8Array;
  88. const uint8Array: (value: unknown) => value is Uint8Array;
  89. const uint8ClampedArray: (value: unknown) => value is Uint8ClampedArray;
  90. const int16Array: (value: unknown) => value is Int16Array;
  91. const uint16Array: (value: unknown) => value is Uint16Array;
  92. const int32Array: (value: unknown) => value is Int32Array;
  93. const uint32Array: (value: unknown) => value is Uint32Array;
  94. const float32Array: (value: unknown) => value is Float32Array;
  95. const float64Array: (value: unknown) => value is Float64Array;
  96. const arrayBuffer: (value: unknown) => value is ArrayBuffer;
  97. const sharedArrayBuffer: (value: unknown) => value is SharedArrayBuffer;
  98. const dataView: (value: unknown) => value is DataView;
  99. const directInstanceOf: <T>(instance: unknown, klass: Class<T>) => instance is T;
  100. const urlInstance: (value: unknown) => value is URL;
  101. const urlString: (value: unknown) => boolean;
  102. const truthy: (value: unknown) => boolean;
  103. const falsy: (value: unknown) => boolean;
  104. const nan: (value: unknown) => boolean;
  105. const primitive: (value: unknown) => value is Primitive;
  106. const integer: (value: unknown) => value is number;
  107. const safeInteger: (value: unknown) => value is number;
  108. const plainObject: (value: unknown) => boolean;
  109. const typedArray: (value: unknown) => value is TypedArray;
  110. const arrayLike: (value: unknown) => value is ArrayLike;
  111. const inRange: (value: number, range: number | number[]) => boolean;
  112. const domElement: (value: unknown) => value is DomElement;
  113. const observable: (value: unknown) => boolean;
  114. const nodeStream: (value: unknown) => value is NodeStream;
  115. const infinite: (value: unknown) => boolean;
  116. const even: (value: number) => boolean;
  117. const odd: (value: number) => boolean;
  118. const emptyArray: (value: unknown) => boolean;
  119. const nonEmptyArray: (value: unknown) => boolean;
  120. const emptyString: (value: unknown) => boolean;
  121. const nonEmptyString: (value: unknown) => boolean;
  122. const emptyStringOrWhitespace: (value: unknown) => boolean;
  123. const emptyObject: (value: unknown) => boolean;
  124. const nonEmptyObject: (value: unknown) => boolean;
  125. const emptySet: (value: unknown) => boolean;
  126. const nonEmptySet: (value: unknown) => boolean;
  127. const emptyMap: (value: unknown) => boolean;
  128. const nonEmptyMap: (value: unknown) => boolean;
  129. const any: (predicate: unknown, ...values: unknown[]) => boolean;
  130. const all: (predicate: unknown, ...values: unknown[]) => boolean;
  131. }
  132. export default is;