interface RequestData extends DocumentOutput, CssRuleData {}

interface DocumentOutput {
    productionRelease?: boolean | string;
    productionIncremental?: boolean;
    serverRootMapping?: StringMap;
    useOriginalHtmlPage?: boolean | string;
    useUnsafeHtmlReplace?: boolean;
    /** @deprecated */
    useSessionCache?: boolean;
    stripCommentsAndCDATA?: boolean | string;
    normalizeHtmlOutput?: boolean | string;
    escapeReservedCharacters?: boolean;
    ignoreServerCodeBlocks?: string[];
    sanitizeFramework?: string[];
    webBundle?: {
        rootDirAlias?: string;
        baseUrl?: string;
        primaryUrl?: string;
        copyTo?: string;
        rewriteHtmlPage?: boolean | string;
        excludeHtmlPage?: boolean;
        includeScopes?: string[];
        excludeScopes?: string[];
    };
    templateMap?: TemplateMap;
    userAgentData?: UserAgentData;
}

interface ImportFrom {
    placeholder: string;
    original: string;
    uri: string;
    type?: string;
    dynamic?: boolean;
}

interface ChromeAsset<T = unknown> extends FileAsset, ImportAction<ImportFrom[] | boolean>, BundleAction, ElementAction<T>, AttributeAction, MetadataAction, StorageAction, HashAction, ExcludeAction, FromAction, WorkerAction {
    preserve?: boolean;
    static?: boolean;
    editing?: boolean;
    inlineFilename?: string;
    inlineContent?: string;
    originAddress?: boolean;
}

interface OutputModifiers extends ExcludeAction, WorkerAction {
    inline?: boolean;
    blob?: boolean | string;
    preserve?: boolean;
    download?: boolean;
    extract?: boolean;
    static?: boolean;
    module?: boolean;
    dynamic?: boolean;
    remove?: boolean;
    ignore?: boolean;
}

interface TemplatePlugin {
    type?: string;
    module?: string;
    identifier?: string;
    value?: string;
}

interface DataSource {
    type: "text" | "attribute" | "display";
    dynamic?: boolean;
    value?: string | string[] | ObjectMap<unknown>;
    viewEngine?: ViewEngine | string;
}

interface AssetCommand extends OutputCommand, OutputModifiers, IncrementalAction, ElementAction, TextAction {
    saveAs?: string;
    exportAs?: string;
    saveTo?: string;
    dataSource?: DataSource;
    mergeType?: "over" | "under" | "none";
    template?: TemplatePlugin;
}

interface TemplateMap {
    html?: ObjectMap<StringMap>;
    js?: ObjectMap<StringMap>;
    css?: ObjectMap<StringMap>;
    data?: StringMap;
}