123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- /**
- * Basic declarations for the npm modules we use.
- */
- declare module "micromatch" {
- declare module.exports: {
- (Array<string>, Array<string>, ?{ nocase: boolean }): Array<string>,
- };
- }
- declare module "resolve" {
- declare export default {
- sync: (string, {| basedir: string |}) => string;
- };
- }
- declare module "json5" {
- declare export default {
- parse: (string) => mixed,
- };
- }
- declare module "lodash/defaults" {
- declare export default <T: Object>(T, Object) => T;
- }
- declare module "lodash/clone" {
- declare export default <T>(obj: T) => T;
- }
- declare module "lodash/merge" {
- declare export default <T: Object>(T, Object) => T;
- }
- declare module "source-map" {
- declare export type SourceMap = {
- version: 3,
- file: ?string,
- sourceRoot: ?string,
- sources: [?string],
- sourcesContent: [?string],
- names: [?string],
- mappings: string,
- };
- declare module.exports: {
- SourceMapConsumer: typeof SourceMapConsumer,
- SourceMapGenerator: typeof SourceMapGenerator,
- }
- declare class SourceMapConsumer {
- static GENERATED_ORDER: 1;
- static ORIGINAL_ORDER: 2;
- file: string | null;
- sourceRoot: string | null;
- sources: Array<string>;
- constructor(?SourceMap): this;
- computeColumnSpans(): string;
- originalPositionFor({
- line: number,
- column: number,
- }): {|
- source: string,
- line: number,
- column: number,
- name: string | null
- |} | {|
- source: null,
- line: null,
- column: null,
- name: null
- |};
- generatedPositionFor({
- source: string,
- line: number,
- column: number,
- }): {|
- line: number,
- column: number,
- lastColumn: number | null | void,
- |} | {|
- line: null,
- column: null,
- lastColumn: null | void,
- |};
- allGeneratedPositionsFor({
- source: string,
- line: number,
- column: number,
- }): Array<{|
- line: number,
- column: number,
- lastColumn: number,
- |}>;
- sourceContentFor(string, boolean | void): string | null;
- eachMapping(
- ({|
- generatedLine: number,
- generatedColumn: number,
- source: string,
- originalLine: number,
- originalColumn: number,
- name: string | null,
- |} | {|
- generatedLine: number,
- generatedColumn: number,
- source: null,
- originalLine: null,
- originalColumn: null,
- name: null,
- |}) => mixed,
- context: mixed,
- order: ?(1 | 2),
- ): void;
- }
- declare class SourceMapGenerator {
- constructor(?{
- file?: string | null,
- sourceRoot?: string | null,
- skipValidation?: boolean | null,
- }): this;
- addMapping({
- generated: {
- line: number,
- column: number,
- }
- }): void;
- setSourceContent(string, string): void;
- toJSON(): SourceMap;
- }
- }
- declare module "convert-source-map" {
- import type { SourceMap } from "source-map";
- declare class Converter {
- toJSON(): string;
- toBase64(): string;
- toComment(): string;
- toObject(): SourceMap
- }
- declare module.exports: {
- SourceMap: SourceMap,
- Converter: Converter,
- fromObject(obj: SourceMap): Converter,
- fromJSON(str: string): Converter,
- fromBase64(str: string): Converter,
- fromComment(str: string): Converter,
- fromMapFileComment(str: string): Converter,
- fromSource(str: string): Converter,
- fromMapFileSource(str: string): Converter,
- removeComments(str: string): string,
- removeMapFileComments(str: string): string,
- generateMapFileComment(path: string, options?: ?{ multiline: boolean }): string,
- };
- }
|