Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

util.d.ts 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. declare module 'util' {
  2. interface InspectOptions extends NodeJS.InspectOptions { }
  3. type Style = 'special' | 'number' | 'bigint' | 'boolean' | 'undefined' | 'null' | 'string' | 'symbol' | 'date' | 'regexp' | 'module';
  4. type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => string;
  5. interface InspectOptionsStylized extends InspectOptions {
  6. stylize(text: string, styleType: Style): string;
  7. }
  8. function format(format?: any, ...param: any[]): string;
  9. function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string;
  10. /** @deprecated since v0.11.3 - use a third party module instead. */
  11. function log(string: string): void;
  12. function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;
  13. function inspect(object: any, options: InspectOptions): string;
  14. namespace inspect {
  15. let colors: NodeJS.Dict<[number, number]>;
  16. let styles: {
  17. [K in Style]: string
  18. };
  19. let defaultOptions: InspectOptions;
  20. /**
  21. * Allows changing inspect settings from the repl.
  22. */
  23. let replDefaults: InspectOptions;
  24. const custom: unique symbol;
  25. }
  26. /** @deprecated since v4.0.0 - use `Array.isArray()` instead. */
  27. function isArray(object: any): object is any[];
  28. /** @deprecated since v4.0.0 - use `util.types.isRegExp()` instead. */
  29. function isRegExp(object: any): object is RegExp;
  30. /** @deprecated since v4.0.0 - use `util.types.isDate()` instead. */
  31. function isDate(object: any): object is Date;
  32. /** @deprecated since v4.0.0 - use `util.types.isNativeError()` instead. */
  33. function isError(object: any): object is Error;
  34. function inherits(constructor: any, superConstructor: any): void;
  35. function debuglog(key: string): (msg: string, ...param: any[]) => void;
  36. /** @deprecated since v4.0.0 - use `typeof value === 'boolean'` instead. */
  37. function isBoolean(object: any): object is boolean;
  38. /** @deprecated since v4.0.0 - use `Buffer.isBuffer()` instead. */
  39. function isBuffer(object: any): object is Buffer;
  40. /** @deprecated since v4.0.0 - use `typeof value === 'function'` instead. */
  41. function isFunction(object: any): boolean;
  42. /** @deprecated since v4.0.0 - use `value === null` instead. */
  43. function isNull(object: any): object is null;
  44. /** @deprecated since v4.0.0 - use `value === null || value === undefined` instead. */
  45. function isNullOrUndefined(object: any): object is null | undefined;
  46. /** @deprecated since v4.0.0 - use `typeof value === 'number'` instead. */
  47. function isNumber(object: any): object is number;
  48. /** @deprecated since v4.0.0 - use `value !== null && typeof value === 'object'` instead. */
  49. function isObject(object: any): boolean;
  50. /** @deprecated since v4.0.0 - use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead. */
  51. function isPrimitive(object: any): boolean;
  52. /** @deprecated since v4.0.0 - use `typeof value === 'string'` instead. */
  53. function isString(object: any): object is string;
  54. /** @deprecated since v4.0.0 - use `typeof value === 'symbol'` instead. */
  55. function isSymbol(object: any): object is symbol;
  56. /** @deprecated since v4.0.0 - use `value === undefined` instead. */
  57. function isUndefined(object: any): object is undefined;
  58. function deprecate<T extends Function>(fn: T, message: string, code?: string): T;
  59. function isDeepStrictEqual(val1: any, val2: any): boolean;
  60. function callbackify(fn: () => Promise<void>): (callback: (err: NodeJS.ErrnoException) => void) => void;
  61. function callbackify<TResult>(fn: () => Promise<TResult>): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
  62. function callbackify<T1>(fn: (arg1: T1) => Promise<void>): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void;
  63. function callbackify<T1, TResult>(fn: (arg1: T1) => Promise<TResult>): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
  64. function callbackify<T1, T2>(fn: (arg1: T1, arg2: T2) => Promise<void>): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void;
  65. function callbackify<T1, T2, TResult>(fn: (arg1: T1, arg2: T2) => Promise<TResult>): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
  66. function callbackify<T1, T2, T3>(fn: (arg1: T1, arg2: T2, arg3: T3) => Promise<void>): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void;
  67. function callbackify<T1, T2, T3, TResult>(
  68. fn: (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
  69. function callbackify<T1, T2, T3, T4>(
  70. fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void;
  71. function callbackify<T1, T2, T3, T4, TResult>(
  72. fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
  73. function callbackify<T1, T2, T3, T4, T5>(
  74. fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void;
  75. function callbackify<T1, T2, T3, T4, T5, TResult>(
  76. fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>,
  77. ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
  78. function callbackify<T1, T2, T3, T4, T5, T6>(
  79. fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<void>,
  80. ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException) => void) => void;
  81. function callbackify<T1, T2, T3, T4, T5, T6, TResult>(
  82. fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<TResult>
  83. ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
  84. interface CustomPromisifyLegacy<TCustom extends Function> extends Function {
  85. __promisify__: TCustom;
  86. }
  87. interface CustomPromisifySymbol<TCustom extends Function> extends Function {
  88. [promisify.custom]: TCustom;
  89. }
  90. type CustomPromisify<TCustom extends Function> = CustomPromisifySymbol<TCustom> | CustomPromisifyLegacy<TCustom>;
  91. function promisify<TCustom extends Function>(fn: CustomPromisify<TCustom>): TCustom;
  92. function promisify<TResult>(fn: (callback: (err: any, result: TResult) => void) => void): () => Promise<TResult>;
  93. function promisify(fn: (callback: (err?: any) => void) => void): () => Promise<void>;
  94. function promisify<T1, TResult>(fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void): (arg1: T1) => Promise<TResult>;
  95. function promisify<T1>(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise<void>;
  96. function promisify<T1, T2, TResult>(fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise<TResult>;
  97. function promisify<T1, T2>(fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2) => Promise<void>;
  98. function promisify<T1, T2, T3, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void):
  99. (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>;
  100. function promisify<T1, T2, T3>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise<void>;
  101. function promisify<T1, T2, T3, T4, TResult>(
  102. fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void,
  103. ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>;
  104. function promisify<T1, T2, T3, T4>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void):
  105. (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>;
  106. function promisify<T1, T2, T3, T4, T5, TResult>(
  107. fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void,
  108. ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>;
  109. function promisify<T1, T2, T3, T4, T5>(
  110. fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void,
  111. ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>;
  112. function promisify(fn: Function): Function;
  113. namespace promisify {
  114. const custom: unique symbol;
  115. }
  116. namespace types {
  117. function isAnyArrayBuffer(object: any): object is ArrayBufferLike;
  118. function isArgumentsObject(object: any): object is IArguments;
  119. function isArrayBuffer(object: any): object is ArrayBuffer;
  120. function isArrayBufferView(object: any): object is NodeJS.ArrayBufferView;
  121. function isAsyncFunction(object: any): boolean;
  122. function isBigInt64Array(value: any): value is BigInt64Array;
  123. function isBigUint64Array(value: any): value is BigUint64Array;
  124. function isBooleanObject(object: any): object is Boolean;
  125. function isBoxedPrimitive(object: any): object is String | Number | BigInt | Boolean | Symbol;
  126. function isDataView(object: any): object is DataView;
  127. function isDate(object: any): object is Date;
  128. function isExternal(object: any): boolean;
  129. function isFloat32Array(object: any): object is Float32Array;
  130. function isFloat64Array(object: any): object is Float64Array;
  131. function isGeneratorFunction(object: any): object is GeneratorFunction;
  132. function isGeneratorObject(object: any): object is Generator;
  133. function isInt8Array(object: any): object is Int8Array;
  134. function isInt16Array(object: any): object is Int16Array;
  135. function isInt32Array(object: any): object is Int32Array;
  136. function isMap<T>(
  137. object: T | {},
  138. ): object is T extends ReadonlyMap<any, any>
  139. ? unknown extends T
  140. ? never
  141. : ReadonlyMap<any, any>
  142. : Map<any, any>;
  143. function isMapIterator(object: any): boolean;
  144. function isModuleNamespaceObject(value: any): boolean;
  145. function isNativeError(object: any): object is Error;
  146. function isNumberObject(object: any): object is Number;
  147. function isPromise(object: any): object is Promise<any>;
  148. function isProxy(object: any): boolean;
  149. function isRegExp(object: any): object is RegExp;
  150. function isSet<T>(
  151. object: T | {},
  152. ): object is T extends ReadonlySet<any>
  153. ? unknown extends T
  154. ? never
  155. : ReadonlySet<any>
  156. : Set<any>;
  157. function isSetIterator(object: any): boolean;
  158. function isSharedArrayBuffer(object: any): object is SharedArrayBuffer;
  159. function isStringObject(object: any): object is String;
  160. function isSymbolObject(object: any): object is Symbol;
  161. function isTypedArray(object: any): object is NodeJS.TypedArray;
  162. function isUint8Array(object: any): object is Uint8Array;
  163. function isUint8ClampedArray(object: any): object is Uint8ClampedArray;
  164. function isUint16Array(object: any): object is Uint16Array;
  165. function isUint32Array(object: any): object is Uint32Array;
  166. function isWeakMap(object: any): object is WeakMap<any, any>;
  167. function isWeakSet(object: any): object is WeakSet<any>;
  168. }
  169. class TextDecoder {
  170. readonly encoding: string;
  171. readonly fatal: boolean;
  172. readonly ignoreBOM: boolean;
  173. constructor(
  174. encoding?: string,
  175. options?: { fatal?: boolean; ignoreBOM?: boolean }
  176. );
  177. decode(
  178. input?: NodeJS.ArrayBufferView | ArrayBuffer | null,
  179. options?: { stream?: boolean }
  180. ): string;
  181. }
  182. interface EncodeIntoResult {
  183. /**
  184. * The read Unicode code units of input.
  185. */
  186. read: number;
  187. /**
  188. * The written UTF-8 bytes of output.
  189. */
  190. written: number;
  191. }
  192. class TextEncoder {
  193. readonly encoding: string;
  194. encode(input?: string): Uint8Array;
  195. encodeInto(input: string, output: Uint8Array): EncodeIntoResult;
  196. }
  197. }