Utility namespace exposed through AsukaDesigner.util.

interface AsukaUtilApi {
    agency: {
        backgroundRemoval: {
            remove: ((input: AsukaBackgroundRemovalInput) => Promise<AsukaBackgroundRemovalResult>);
        };
        branding: {
            apply: ((patch: AsukaBrandingConfig) => {
                cssVariables?: Record<string, string>;
                hidePoweredBy?: boolean;
                logoUrl?: string;
                productName?: string;
                rootClassName?: string;
                whiteLabel?: boolean;
            });
            get: (() => {
                cssVariables: {};
                hidePoweredBy?: boolean;
                logoUrl?: string;
                productName?: string;
                rootClassName?: string;
                whiteLabel?: boolean;
            });
            reset: (() => void);
        };
        exportBundle: (() => AsukaAgencyBundle);
        getAvailability: (() => {
            advancedPermissions: boolean;
            apiAdvanced: boolean;
            backgroundRemoval: boolean;
            whiteLabel: boolean;
        });
        importBundle: ((bundle: Partial<AsukaAgencyBundle>) => AsukaAgencyBundle);
        isAvailable: ((feature: AsukaAgencyFeatureKey) => boolean);
        permissions: {
            applyPolicy: ((patch: Partial<AsukaPermissions>) => void);
            getCurrent: (() => null | AsukaPermissions);
        };
        refreshEntitlements: (() => {
            advancedPermissions: boolean;
            apiAdvanced: boolean;
            backgroundRemoval: boolean;
            whiteLabel: boolean;
        });
    };
    ai: {
        backgroundRemoval: {
            remove: ((input: AsukaBackgroundRemovalInput) => Promise<AsukaBackgroundRemovalResult>);
        };
        consumeCredits: ((amount?: number, reason?: string) => AsukaCommercialQuotaState);
        getAvailability: (() => {
            backgroundRemoval: boolean;
            textToImage: boolean;
        });
        getQuota: (() => AsukaCommercialQuotaState);
        textToImage: {
            generate: ((input: AsukaAiTextToImageInput) => Promise<AsukaAiTextToImageResult>);
        };
    };
    camera: AsukaCameraApi;
    can: ((key: keyof AsukaPermissions) => boolean);
    clearForView: ((viewId: string) => void);
    engine: AsukaEngineApi;
    exports: {
        buildServerHdPayload: ((input?: AsukaServerHdExportInput) => AsukaServerHdExportPayload);
        consumeCredits: ((amount?: number, reason?: string) => AsukaCommercialQuotaState);
        consumePaidExport: ((input?: AsukaPaidExportConsumeInput) => Promise<AsukaPaidExportConsumeResult>);
        getQuota: (() => AsukaCommercialQuotaState);
        serverHd: {
            export: ((input?: AsukaServerHdExportInput) => Promise<AsukaServerHdExportResult>);
        };
    };
    formatPrice: ((amount: string | number, overrides?: Partial<PriceFormat>) => string);
    getForActiveView: (() => Partial<AsukaPermissions>);
    getPermissions: (() => AsukaPermissions);
    getRole: (() => AsukaRole);
    getState: (() => AsukaState);
    i18n: AsukaI18nApi;
    license: AsukaLicenseApi;
    listeners: AsukaListenersApi;
    modules: AsukaModulesApi;
    observability: AsukaObservabilityApi;
    operators: ((operator: string, a: number, b: number) => number | boolean);
    parametric3d: AsukaParametric3DApi;
    require: ((key: keyof AsukaPermissions, payload?: unknown) => void);
    responsive: AsukaResponsiveApi;
    setForView: ((viewId: string, patch: Partial<AsukaPermissions>) => void);
    setPermissions: ((patch: Partial<AsukaPermissions>) => void);
    setRole: ((role: AsukaRole) => void);
    state: AsukaStateApi;
    subscribe: ((listener: ((state: AsukaState, prevState: AsukaState) => void)) => (() => void));
    uiConfig: AsukaRuntimeUiApi;
    uploads: AsukaUploadsApi;
}

Properties

agency: {
    backgroundRemoval: {
        remove: ((input: AsukaBackgroundRemovalInput) => Promise<AsukaBackgroundRemovalResult>);
    };
    branding: {
        apply: ((patch: AsukaBrandingConfig) => {
            cssVariables?: Record<string, string>;
            hidePoweredBy?: boolean;
            logoUrl?: string;
            productName?: string;
            rootClassName?: string;
            whiteLabel?: boolean;
        });
        get: (() => {
            cssVariables: {};
            hidePoweredBy?: boolean;
            logoUrl?: string;
            productName?: string;
            rootClassName?: string;
            whiteLabel?: boolean;
        });
        reset: (() => void);
    };
    exportBundle: (() => AsukaAgencyBundle);
    getAvailability: (() => {
        advancedPermissions: boolean;
        apiAdvanced: boolean;
        backgroundRemoval: boolean;
        whiteLabel: boolean;
    });
    importBundle: ((bundle: Partial<AsukaAgencyBundle>) => AsukaAgencyBundle);
    isAvailable: ((feature: AsukaAgencyFeatureKey) => boolean);
    permissions: {
        applyPolicy: ((patch: Partial<AsukaPermissions>) => void);
        getCurrent: (() => null | AsukaPermissions);
    };
    refreshEntitlements: (() => {
        advancedPermissions: boolean;
        apiAdvanced: boolean;
        backgroundRemoval: boolean;
        whiteLabel: boolean;
    });
}

Agency-only helpers: branding, advanced permissions and white-label/export adapters.

ai: {
    backgroundRemoval: {
        remove: ((input: AsukaBackgroundRemovalInput) => Promise<AsukaBackgroundRemovalResult>);
    };
    consumeCredits: ((amount?: number, reason?: string) => AsukaCommercialQuotaState);
    getAvailability: (() => {
        backgroundRemoval: boolean;
        textToImage: boolean;
    });
    getQuota: (() => AsukaCommercialQuotaState);
    textToImage: {
        generate: ((input: AsukaAiTextToImageInput) => Promise<AsukaAiTextToImageResult>);
    };
}

AI helpers: text-to-image, background removal and AI credit helpers.

Camera controls and variation camera presets.

can: ((key: keyof AsukaPermissions) => boolean)

Test one permission flag against the current effective permission set.

clearForView: ((viewId: string) => void)

Remove a view-specific permission override.

Rendering-engine helpers.

exports: {
    buildServerHdPayload: ((input?: AsukaServerHdExportInput) => AsukaServerHdExportPayload);
    consumeCredits: ((amount?: number, reason?: string) => AsukaCommercialQuotaState);
    consumePaidExport: ((input?: AsukaPaidExportConsumeInput) => Promise<AsukaPaidExportConsumeResult>);
    getQuota: (() => AsukaCommercialQuotaState);
    serverHd: {
        export: ((input?: AsukaServerHdExportInput) => Promise<AsukaServerHdExportResult>);
    };
}

Paid export helpers: PDF credit consumption and server-side HD rendering.

formatPrice: ((amount: string | number, overrides?: Partial<PriceFormat>) => string)

Format a price using the active pricing format.

getForActiveView: (() => Partial<AsukaPermissions>)

Return the permission overrides applied to the active view.

getPermissions: (() => AsukaPermissions)

Return the currently effective permissions.

getRole: (() => AsukaRole)

Return the currently active role.

getState: (() => AsukaState)

Read the full Zustand state.

Internationalization helpers with fallback support.

Runtime licensing helpers and entitlement checks.

Enable/disable built-in runtime listeners and read their settings.

Runtime module presentation overrides.

observability: AsukaObservabilityApi

Host-controlled error reporting helpers.

operators: ((operator: string, a: number, b: number) => number | boolean)

Evaluate one supported pricing/operator helper.

parametric3d: AsukaParametric3DApi

Generic Product 3D parameter controls generated from the active product recipe.

require: ((key: keyof AsukaPermissions, payload?: unknown) => void)

Throw when a permission is not granted.

responsive: AsukaResponsiveApi

Responsive layout helpers.

setForView: ((viewId: string, patch: Partial<AsukaPermissions>) => void)

Apply a view-specific permission override.

setPermissions: ((patch: Partial<AsukaPermissions>) => void)

Merge new permission overrides into the current runtime state.

setRole: ((role: AsukaRole) => void)

Switch the active role.

Export and import serialized designer state.

subscribe: ((listener: ((state: AsukaState, prevState: AsukaState) => void)) => (() => void))

Subscribe to raw Zustand state changes.

Runtime UI behavior helpers.

Shared upload list helpers used by the Upload module.