index.d.ts 1.3 KB

1234567891011121314151617181920212223
  1. import { BasicSourceMapConsumer, IndexedSourceMapConsumer } from 'source-map';
  2. interface MessageSourceLocation {
  3. type: 'exception' | 'error' | 'warning' | 'info' | 'logging' | 'output';
  4. message: string;
  5. file?: string;
  6. line: number;
  7. column: number;
  8. code?: string;
  9. }
  10. interface GenerateCodeFrameOptions {
  11. sourceRoot?: string;
  12. replaceTabsWithSpace?: boolean;
  13. }
  14. export declare function generateCodeFrameSourceMapConsumer(consumer: BasicSourceMapConsumer | IndexedSourceMapConsumer, m: MessageSourceLocation, options?: GenerateCodeFrameOptions): Required<MessageSourceLocation> | undefined;
  15. export declare function generateCodeFrameWithSourceMapPath(filename: string, messages: MessageSourceLocation[] | string, options?: GenerateCodeFrameOptions): Promise<Required<MessageSourceLocation>[]>;
  16. interface GenerateCodeFrameWithStacktraceOptions {
  17. name: string;
  18. inputDir: string;
  19. outputDir: string;
  20. }
  21. export declare function generateCodeFrameWithKotlinStacktrace(stacktrace: string, { name, inputDir, outputDir }: GenerateCodeFrameWithStacktraceOptions): Promise<unknown>;
  22. export declare function generateCodeFrameWithSwiftStacktrace(stacktrace: string, { name, inputDir, outputDir }: GenerateCodeFrameWithStacktraceOptions): Promise<unknown>;
  23. export {};