Files
node-template-express/types/polyfill.d.ts
2020-11-16 13:14:05 +01:00

38 lines
992 B
TypeScript

declare module "polyfill-library" {
import {Readable} from 'stream';
function listAllPolyfills(): string[];
function describePolyfill(featureName: string): Promise<PolyfillMetadata|undefined>;
function getOptions(opts: Partial<PolyfillOptions>): PolyfillOptions;
function getPolyfills(opts: Partial<PolyfillOptions>): Promise<PolyfillFeatures>;
function getPolyfillString(opts: Partial<PolyfillOptions>&{stream?: true}): Readable;
function getPolyfillString(opts: Partial<PolyfillOptions>&{stream: false}): Promise<string>;
type PolyfillMetadata = {
};
type PolyfillFeatureList = {
[featureName: string]: {
flags?: string[]
}
};
type PolyfillOptions = {
minify: boolean,
unknown: 'polyfill'|'ignore',
features: PolyfillFeatureList,
excludes: string[],
uaString: string,
rum: boolean,
};
type PolyfillFeature = {
flags: string[],
dependencyOf: string[],
aliasOf: string[],
}
type PolyfillFeatures = { [featureName: string]: PolyfillFeature };
}