UNPKG

645 BTypeScriptView Raw
1import type { Loader, TransformOptions } from 'esbuild';
2
3export type Extension = `.${string}`;
4export type Options = TransformOptions;
5
6export type Config = {
7 [extn: Extension]: Options;
8}
9
10export type ConfigFile =
11 | { common?: Options; config?: Config; loaders?: never; [extn: Extension]: never }
12 | { common?: Options; loaders?: Loaders; config?: never; [extn: Extension]: never }
13 | { common?: Options; config?: never; loaders?: never; [extn: Extension]: Options }
14
15export type Loaders = {
16 [extn: Extension]: Loader;
17}
18
19/**
20 * TypeScript helper for writing `tsm.js` contents.
21 */
22export function define(contents: ConfigFile): ConfigFile;