// Copyright 2018 the Deno authors. All rights reserved. MIT license. export type TypedArray = Uint8Array | Float32Array | Int32Array; export interface ModuleInfo { moduleName: string | null; filename: string | null; sourceCode: string | null; outputCode: string | null; } // Following definitions adapted from: // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/index.d.ts // Type definitions for Node.js 10.3.x // Definitions by: Microsoft TypeScript // DefinitelyTyped // Parambir Singh // Christian Vaagland Tellnes // Wilco Bakker // Nicolas Voigt // Chigozirim C. // Flarna // Mariusz Wiktorczyk // wwwy3y3 // Deividas Bakanas // Kelvin Jin // Alvis HT Tang // Sebastian Silbermann // Hannes Magnusson // Alberto Schiabel // Klaus Meinhardt // Huw // Nicolas Even // Bruno Scheufler // Mohsen Azimi // Hoàng Văn Khải // Alexander T. // Lishude // Andrew Makarov export interface CallSite { /** * Value of "this" */ getThis(): any; /** * Type of "this" as a string. * This is the name of the function stored in the constructor field of * "this", if available. Otherwise the object's [[Class]] internal * property. */ getTypeName(): string | null; /** * Current function */ getFunction(): Function | undefined; /** * Name of the current function, typically its name property. * If a name property is not available an attempt will be made to try * to infer a name from the function's context. */ getFunctionName(): string | null; /** * Name of the property [of "this" or one of its prototypes] that holds * the current function */ getMethodName(): string | null; /** * Name of the script [if this function was defined in a script] */ getFileName(): string | null; /** * Get the script name or source URL for the source map */ getScriptNameOrSourceURL(): string; /** * Current line number [if this function was defined in a script] */ getLineNumber(): number | null; /** * Current column number [if this function was defined in a script] */ getColumnNumber(): number | null; /** * A call site object representing the location where eval was called * [if this function was created using a call to eval] */ getEvalOrigin(): string | undefined; /** * Is this a toplevel invocation, that is, is "this" the global object? */ isToplevel(): boolean; /** * Does this call take place in code defined by a call to eval? */ isEval(): boolean; /** * Is this call in native V8 code? */ isNative(): boolean; /** * Is this a constructor call? */ isConstructor(): boolean; } export interface StartOfSourceMap { file?: string; sourceRoot?: string; } export interface RawSourceMap extends StartOfSourceMap { version: string; sources: string[]; names: string[]; sourcesContent?: string[]; mappings: string; } declare global { // Declare "static" methods in Error interface ErrorConstructor { /** Create .stack property on a target object */ captureStackTrace(targetObject: Object, constructorOpt?: Function): void; /** * Optional override for formatting stack traces * * @see https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces */ prepareStackTrace?: (err: Error, stackTraces: CallSite[]) => any; stackTraceLimit: number; } }