KC's Workspace
    Preparing search index...

    Make all properties in T optional

    interface Plugin<A = any> {
        api?: A;
        augmentChunkHash?: ObjectHook<
            (this: PluginContext, chunk: RenderedChunk) => string | void,
            {},
        >;
        banner?: ObjectHook<AddonHook, {}>;
        buildEnd?: ObjectHook<
            (
                this: PluginContext,
                ...parameters: [error?: Error],
            ) => void | Promise<void>,
            { sequential?: boolean },
        >;
        buildStart?: ObjectHook<
            (
                this: PluginContext,
                ...parameters: [options: NormalizedInputOptions],
            ) => void | Promise<void>,
            { sequential?: boolean },
        >;
        cacheKey?: string;
        closeBundle?: ObjectHook<
            (
                this: PluginContext,
                ...parameters: [error?: Error],
            ) => void | Promise<void>,
            { sequential?: boolean },
        >;
        closeWatcher?: ObjectHook<
            (this: PluginContext, ...parameters: []) => void | Promise<void>,
            { sequential?: boolean },
        >;
        footer?: ObjectHook<AddonHook, {}>;
        generateBundle?: ObjectHook<
            (
                this: PluginContext,
                ...parameters: [
                    options: NormalizedOutputOptions,
                    bundle: OutputBundle,
                    isWrite: boolean,
                ],
            ) => void
            | Promise<void>,
            {},
        >;
        intro?: ObjectHook<AddonHook, {}>;
        load?: ObjectHook<
            (
                this: PluginContext,
                ...parameters: [id: string],
            ) => LoadResult | Promise<LoadResult>,
            { filter?: Pick<HookFilter, "id"> },
        >;
        moduleParsed?: ObjectHook<
            (
                this: PluginContext,
                ...parameters: [info: ModuleInfo],
            ) => void | Promise<void>,
            { sequential?: boolean },
        >;
        name: string;
        onLog?: ObjectHook<
            (
                this: MinimalPluginContext,
                level: LogLevel,
                log: RollupLog,
            ) => boolean | NullValue,
            {},
        >;
        options?: ObjectHook<
            (
                this: MinimalPluginContext,
                ...parameters: [options: InputOptions],
            ) => InputOptions | NullValue | Promise<InputOptions | NullValue>,
            {},
        >;
        outputOptions?: ObjectHook<
            (
                this: PluginContext,
                options: OutputOptions,
            ) => OutputOptions | NullValue,
            {},
        >;
        outro?: ObjectHook<AddonHook, {}>;
        renderChunk?: ObjectHook<
            (
                this: PluginContext,
                ...parameters: [
                    code: string,
                    chunk: RenderedChunk,
                    options: NormalizedOutputOptions,
                    meta: { chunks: Record<string, RenderedChunk> },
                ],
            ) => string | NullValue | { code: string; map?: SourceMapInput; } | Promise<string | NullValue | { code: string; map?: SourceMapInput; }>,
            {},
        >;
        renderDynamicImport?: ObjectHook<
            (
                this: PluginContext,
                options: {
                    chunk: PreRenderedChunkWithFileName;
                    customResolution: string | null;
                    format: InternalModuleFormat;
                    getTargetChunkImports: () => DynamicImportTargetChunk[] | null;
                    moduleId: string;
                    targetChunk: PreRenderedChunkWithFileName | null;
                    targetModuleId: string | null;
                },
            ) => NullValue | { left: string; right: string; },
            {},
        >;
        renderError?: ObjectHook<
            (
                this: PluginContext,
                ...parameters: [error?: Error],
            ) => void | Promise<void>,
            { sequential?: boolean },
        >;
        renderStart?: ObjectHook<
            (
                this: PluginContext,
                ...parameters: [
                    outputOptions: NormalizedOutputOptions,
                    inputOptions: NormalizedInputOptions,
                ],
            ) => void
            | Promise<void>,
            { sequential?: boolean },
        >;
        resolveDynamicImport?: ObjectHook<
            (
                this: PluginContext,
                ...parameters: [
                    specifier: string
                    | AstNode,
                    importer: string,
                    options: { attributes: Record<string, string> },
                ],
            ) => ResolveIdResult | Promise<ResolveIdResult>,
            {},
        >;
        resolveFileUrl?: ObjectHook<ResolveFileUrlHook, {}>;
        resolveId?: ObjectHook<
            (
                this: PluginContext,
                ...parameters: [
                    source: string,
                    importer: string,
                    options: {
                        attributes: Record<string, string>;
                        custom?: CustomPluginOptions;
                        isEntry: boolean;
                    },
                ],
            ) => ResolveIdResult | Promise<ResolveIdResult>,
            { filter?: { id?: StringFilter<RegExp> | undefined } },
        >;
        resolveImportMeta?: ObjectHook<ResolveImportMetaHook, {}>;
        shouldTransformCachedModule?: ObjectHook<
            (
                this: PluginContext,
                ...parameters: [
                    options: {
                        ast: ProgramNode;
                        code: string;
                        id: string;
                        meta: CustomPluginOptions;
                        moduleSideEffects: boolean
                        | "no-treeshake";
                        resolvedSources: ResolvedIdMap;
                        syntheticNamedExports: string | boolean;
                    },
                ],
            ) => boolean | NullValue | Promise<boolean | NullValue>,
            {},
        >;
        transform?: ObjectHook<
            (
                this: TransformPluginContext,
                ...parameters: [code: string, id: string],
            ) => TransformResult | Promise<TransformResult>,
            { filter?: HookFilter },
        >;
        version?: string;
        watchChange?: ObjectHook<
            (
                this: PluginContext,
                ...parameters: [id: string, change: { event: ChangeEvent }],
            ) => void | Promise<void>,
            { sequential?: boolean },
        >;
        writeBundle?: ObjectHook<
            (
                this: PluginContext,
                ...parameters: [options: NormalizedOutputOptions, bundle: OutputBundle],
            ) => void | Promise<void>,
            { sequential?: boolean },
        >;
    }

    Type Parameters

    • A = any

    Hierarchy (View Summary)

    Index

    Properties

    api?: A
    augmentChunkHash?: ObjectHook<
        (this: PluginContext, chunk: RenderedChunk) => string | void,
        {},
    >
    banner?: ObjectHook<AddonHook, {}>
    buildEnd?: ObjectHook<
        (
            this: PluginContext,
            ...parameters: [error?: Error],
        ) => void | Promise<void>,
        { sequential?: boolean },
    >
    buildStart?: ObjectHook<
        (
            this: PluginContext,
            ...parameters: [options: NormalizedInputOptions],
        ) => void | Promise<void>,
        { sequential?: boolean },
    >
    cacheKey?: string
    closeBundle?: ObjectHook<
        (
            this: PluginContext,
            ...parameters: [error?: Error],
        ) => void | Promise<void>,
        { sequential?: boolean },
    >
    closeWatcher?: ObjectHook<
        (this: PluginContext, ...parameters: []) => void | Promise<void>,
        { sequential?: boolean },
    >
    footer?: ObjectHook<AddonHook, {}>
    generateBundle?: ObjectHook<
        (
            this: PluginContext,
            ...parameters: [
                options: NormalizedOutputOptions,
                bundle: OutputBundle,
                isWrite: boolean,
            ],
        ) => void
        | Promise<void>,
        {},
    >
    intro?: ObjectHook<AddonHook, {}>
    load?: ObjectHook<
        (
            this: PluginContext,
            ...parameters: [id: string],
        ) => LoadResult | Promise<LoadResult>,
        { filter?: Pick<HookFilter, "id"> },
    >
    moduleParsed?: ObjectHook<
        (
            this: PluginContext,
            ...parameters: [info: ModuleInfo],
        ) => void | Promise<void>,
        { sequential?: boolean },
    >
    name: string
    onLog?: ObjectHook<
        (
            this: MinimalPluginContext,
            level: LogLevel,
            log: RollupLog,
        ) => boolean | NullValue,
        {},
    >
    options?: ObjectHook<
        (
            this: MinimalPluginContext,
            ...parameters: [options: InputOptions],
        ) => InputOptions | NullValue | Promise<InputOptions | NullValue>,
        {},
    >
    outputOptions?: ObjectHook<
        (
            this: PluginContext,
            options: OutputOptions,
        ) => OutputOptions | NullValue,
        {},
    >
    outro?: ObjectHook<AddonHook, {}>
    renderChunk?: ObjectHook<
        (
            this: PluginContext,
            ...parameters: [
                code: string,
                chunk: RenderedChunk,
                options: NormalizedOutputOptions,
                meta: { chunks: Record<string, RenderedChunk> },
            ],
        ) => string | NullValue | { code: string; map?: SourceMapInput; } | Promise<string | NullValue | { code: string; map?: SourceMapInput; }>,
        {},
    >
    renderDynamicImport?: ObjectHook<
        (
            this: PluginContext,
            options: {
                chunk: PreRenderedChunkWithFileName;
                customResolution: string | null;
                format: InternalModuleFormat;
                getTargetChunkImports: () => DynamicImportTargetChunk[] | null;
                moduleId: string;
                targetChunk: PreRenderedChunkWithFileName | null;
                targetModuleId: string | null;
            },
        ) => NullValue | { left: string; right: string; },
        {},
    >
    renderError?: ObjectHook<
        (
            this: PluginContext,
            ...parameters: [error?: Error],
        ) => void | Promise<void>,
        { sequential?: boolean },
    >
    renderStart?: ObjectHook<
        (
            this: PluginContext,
            ...parameters: [
                outputOptions: NormalizedOutputOptions,
                inputOptions: NormalizedInputOptions,
            ],
        ) => void
        | Promise<void>,
        { sequential?: boolean },
    >
    resolveDynamicImport?: ObjectHook<
        (
            this: PluginContext,
            ...parameters: [
                specifier: string
                | AstNode,
                importer: string,
                options: { attributes: Record<string, string> },
            ],
        ) => ResolveIdResult | Promise<ResolveIdResult>,
        {},
    >
    resolveFileUrl?: ObjectHook<ResolveFileUrlHook, {}>
    resolveId?: ObjectHook<
        (
            this: PluginContext,
            ...parameters: [
                source: string,
                importer: string,
                options: {
                    attributes: Record<string, string>;
                    custom?: CustomPluginOptions;
                    isEntry: boolean;
                },
            ],
        ) => ResolveIdResult | Promise<ResolveIdResult>,
        { filter?: { id?: StringFilter<RegExp> | undefined } },
    >
    resolveImportMeta?: ObjectHook<ResolveImportMetaHook, {}>
    shouldTransformCachedModule?: ObjectHook<
        (
            this: PluginContext,
            ...parameters: [
                options: {
                    ast: ProgramNode;
                    code: string;
                    id: string;
                    meta: CustomPluginOptions;
                    moduleSideEffects: boolean
                    | "no-treeshake";
                    resolvedSources: ResolvedIdMap;
                    syntheticNamedExports: string | boolean;
                },
            ],
        ) => boolean | NullValue | Promise<boolean | NullValue>,
        {},
    >
    transform?: ObjectHook<
        (
            this: TransformPluginContext,
            ...parameters: [code: string, id: string],
        ) => TransformResult | Promise<TransformResult>,
        { filter?: HookFilter },
    >
    version?: string
    watchChange?: ObjectHook<
        (
            this: PluginContext,
            ...parameters: [id: string, change: { event: ChangeEvent }],
        ) => void | Promise<void>,
        { sequential?: boolean },
    >
    writeBundle?: ObjectHook<
        (
            this: PluginContext,
            ...parameters: [options: NormalizedOutputOptions, bundle: OutputBundle],
        ) => void | Promise<void>,
        { sequential?: boolean },
    >