Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import the TypeScript definition for StackFrame from stackframe #228

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 6 additions & 52 deletions stacktrace-js.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// Definitions by: Eric Wendelin <https://github.com/exceptionless>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import StackFrame = require("stackframe");

declare namespace StackTrace {

export interface SourceCache {
Expand All @@ -15,55 +17,7 @@ declare namespace StackTrace {
offline?: boolean;
}

export interface StackFrame {
constructor(object: StackFrame): StackFrame;

isConstructor?: boolean;
getIsConstructor(): boolean;
setIsConstructor(): void;

isEval?: boolean;
getIsEval(): boolean;
setIsEval(): void;

isNative?: boolean;
getIsNative(): boolean;
setIsNative(): void;

isTopLevel?: boolean;
getIsTopLevel(): boolean;
setIsTopLevel(): void;

columnNumber?: number;
getColumnNumber(): number;
setColumnNumber(): void;

lineNumber?: number;
getLineNumber(): number;
setLineNumber(): void;

fileName?: string;
getFileName(): string;
setFileName(): void;

functionName?: string;
getFunctionName(): string;
setFunctionName(): void;

source?: string;
getSource(): string;
setSource(): void;

args?: any[];
getArgs(): any[];
setArgs(): void;

evalOrigin?: StackFrame;
getEvalOrigin(): StackFrame;
setEvalOrigin(): void;

toString(): string;
}
export type {StackFrame};

/**
* Get a backtrace from invocation point.
Expand Down Expand Up @@ -129,6 +83,6 @@ declare namespace StackTrace {
export function report(stackframes: StackFrame[], url: string, errorMsg?: string, requestOptions?: object): Promise<any>;
}

declare module "stacktrace-js" {
export = StackTrace;
}
export = StackTrace;

export as namespace StackTrace; // global for non-module UMD users