import { NameVersion } from "@pslb/rollup-plugin-dll"; import { VersionRange } from "@pslb/rollup-plugin-dll/lib/types"; export declare type Mode = "development" | "production"; export interface Lib { name: string; } /** * A lib that has already been built elsewhere and is just being pulled in. * No need to build it. */ export interface RemoteLib extends Lib { version: string; } export declare const isRemoteLib: (a: any) => a is RemoteLib; export interface LibConfig extends Lib { scope: string; repository: string; mode: Mode; modules?: NameVersion[]; extensions?: { commonJs?: any; }; /** * Ideally namespace imports would be the default import method. * But this can cause problems if a library does the following: * `module.exports = require("path");` - this causes the properties to get lost, * when really we'd like all the properties to be set on the module. * For now - specify the import method as a key of `imports`. * * To fix this we'd probably need to make a change to rollup, * get it to follow the var until it gets to the object definition, * then to use the keys to set the export object. * * @see rollup/src/ast/NamespaceVariable * @see rollup/plugin-commonjs/ too */ imports: { default: string[]; namespace: string[]; }; customEntryHeader: string; } export declare type ModuleLinks = "relative" | "unpkg" | undefined; export declare type GetUrlFn = (from: NameVersion, to: NameVersion) => string; export declare type OutputFn = (name: string, version: string, type: "controller" | "configure" | "element") => string; export declare type KeyValueMap = { [key: string]: string; }; /** A package.json w/ optional pslb settings */ export declare type PackageJson = { name: string; version: string; dependencies: KeyValueMap; pslb?: { overrides?: KeyValueMap; }; }; /** * If the element is a string - it's a dependency defined in `dependencies`. * If it's a `PackageAndPath` it's a local child package. */ export declare type PieInfo = { element?: string | PackageAndPath; controller?: string | PackageAndPath; configure?: string | PackageAndPath; }; export declare type PiePkg = { name: string; version: string; pie: PieInfo; dependencies: KeyValueMap; }; export interface PackageAndPath extends PAndPath { } export interface PiePkgAndPath extends PAndPath { } export interface PAndPath

{ pkg: P; path: string; } export declare type Config = { range?: VersionRange; mode: Mode; sourceMaps?: string; skipPackages?: boolean; devBuild?: boolean; forceLibBump?: boolean; publishLibs?: boolean; cleanLibs?: boolean; token?: string; serve?: boolean; watch?: boolean; /** * For any modules that are not created as part of the config, but are loaded by the source, * what is the link type for loading that module. * 'relative' - calculate the relative url. This is the default as it works well once the modules are deployed. * 'unpkg' - create the full unpkg url - useful if you want to preview locally */ moduleLinks: ModuleLinks; /** * pie-package - need to build element/controller/configure in pie map in the package.json or as dirs * npm-package - just a regular npm package */ type: "pie-package" | "npm-package"; piePkgOpts?: { configure?: boolean; controller?: boolean; element?: boolean; }; minify: boolean; /** A list of packages to build */ packages: string[]; /** Fully resolved path to dir that holds packages */ packagesDir: string; /** config for rollup common js plugin */ extensions?: { commonJs?: any; }; /** the configuration for any libs that need to be generated */ libs: { repository: string; packages: (LibConfig | RemoteLib)[]; }; }; export declare type LibFile = { type: "asset" | "chunk"; fileName: string; };