Provides utility functions that project data providers should call when handling project settings

interface IProjectSettingsService {
    getDefault<ProjectSettingName extends keyof ProjectSettingTypes>(
        key: ProjectSettingName,
    ): Promise<ProjectSettingTypes[ProjectSettingName]>;
    getLocalizedContributionInfo(): Promise<
        | undefined
        | {
            contributions: {
                [key: string]: | undefined
                | {
                    description?: string;
                    label: string;
                    properties: {
                        [key: `${string}.${string}`]: {
                            default: unknown;
                            derivesFrom?: string;
                            description?: string;
                            excludePdpFactoryIds?: string
                            | (...)[];
                            excludeProjectInterfaces?: string | (...)[];
                            includePdpFactoryIds?: string | (...)[];
                            includeProjectInterfaces?: string | (...)[];
                            label: string;
                            platformType?: undefined;
                            type?: undefined;
                            [key: string]: unknown;
                        };
                    };
                    [key: string]: unknown;
                }[];
            };
            settings: {
                "platform.fullName"?: {
                    default: string;
                    derivesFrom?: string;
                    description?: string;
                    excludePdpFactoryIds?: string
                    | string[];
                    excludeProjectInterfaces?: string | (string | string[])[];
                    includePdpFactoryIds?: string | string[];
                    includeProjectInterfaces?: string | (string | string[])[];
                    label: string;
                    platformType?: undefined;
                    type?: undefined;
                    [key: string]: unknown;
                };
                "platform.isEditable"?: {
                    default: boolean;
                    derivesFrom?: string;
                    description?: string;
                    excludePdpFactoryIds?: string
                    | string[];
                    excludeProjectInterfaces?: string | (string | string[])[];
                    includePdpFactoryIds?: string | string[];
                    includeProjectInterfaces?: string | (string | string[])[];
                    label: string;
                    platformType?: undefined;
                    type?: undefined;
                    [key: string]: unknown;
                };
                "platform.language"?: {
                    default: string;
                    derivesFrom?: string;
                    description?: string;
                    excludePdpFactoryIds?: string
                    | string[];
                    excludeProjectInterfaces?: string | (string | string[])[];
                    includePdpFactoryIds?: string | string[];
                    includeProjectInterfaces?: string | (string | string[])[];
                    label: string;
                    platformType?: undefined;
                    type?: undefined;
                    [key: string]: unknown;
                };
                "platform.name"?: {
                    default: string;
                    derivesFrom?: string;
                    description?: string;
                    excludePdpFactoryIds?: string
                    | string[];
                    excludeProjectInterfaces?: string | (string | string[])[];
                    includePdpFactoryIds?: string | string[];
                    includeProjectInterfaces?: string | (string | string[])[];
                    label: string;
                    platformType?: undefined;
                    type?: undefined;
                    [key: string]: unknown;
                };
            };
        },
    >;
    isValid<ProjectSettingName extends keyof ProjectSettingTypes>(
        key: ProjectSettingName,
        newValue: ProjectSettingTypes[ProjectSettingName],
        currentValue: ProjectSettingTypes[ProjectSettingName],
        allChanges?: SimultaneousProjectSettingsChanges,
    ): Promise<boolean>;
    registerValidator<ProjectSettingName extends keyof ProjectSettingTypes>(
        key: ProjectSettingName,
        validatorCallback: ProjectSettingValidator<ProjectSettingName>,
    ): Promise<UnsubscriberAsync>;
}

Methods

  • Get the current set of project settings contribution info given all the input documents with all localized string keys localized properly.

    Returns Promise<
        | undefined
        | {
            contributions: {
                [key: string]: | undefined
                | {
                    description?: string;
                    label: string;
                    properties: {
                        [key: `${string}.${string}`]: {
                            default: unknown;
                            derivesFrom?: string;
                            description?: string;
                            excludePdpFactoryIds?: string
                            | (...)[];
                            excludeProjectInterfaces?: string | (...)[];
                            includePdpFactoryIds?: string | (...)[];
                            includeProjectInterfaces?: string | (...)[];
                            label: string;
                            platformType?: undefined;
                            type?: undefined;
                            [key: string]: unknown;
                        };
                    };
                    [key: string]: unknown;
                }[];
            };
            settings: {
                "platform.fullName"?: {
                    default: string;
                    derivesFrom?: string;
                    description?: string;
                    excludePdpFactoryIds?: string
                    | string[];
                    excludeProjectInterfaces?: string | (string | string[])[];
                    includePdpFactoryIds?: string | string[];
                    includeProjectInterfaces?: string | (string | string[])[];
                    label: string;
                    platformType?: undefined;
                    type?: undefined;
                    [key: string]: unknown;
                };
                "platform.isEditable"?: {
                    default: boolean;
                    derivesFrom?: string;
                    description?: string;
                    excludePdpFactoryIds?: string
                    | string[];
                    excludeProjectInterfaces?: string | (string | string[])[];
                    includePdpFactoryIds?: string | string[];
                    includeProjectInterfaces?: string | (string | string[])[];
                    label: string;
                    platformType?: undefined;
                    type?: undefined;
                    [key: string]: unknown;
                };
                "platform.language"?: {
                    default: string;
                    derivesFrom?: string;
                    description?: string;
                    excludePdpFactoryIds?: string
                    | string[];
                    excludeProjectInterfaces?: string | (string | string[])[];
                    includePdpFactoryIds?: string | string[];
                    includeProjectInterfaces?: string | (string | string[])[];
                    label: string;
                    platformType?: undefined;
                    type?: undefined;
                    [key: string]: unknown;
                };
                "platform.name"?: {
                    default: string;
                    derivesFrom?: string;
                    description?: string;
                    excludePdpFactoryIds?: string
                    | string[];
                    excludeProjectInterfaces?: string | (string | string[])[];
                    includePdpFactoryIds?: string | string[];
                    includeProjectInterfaces?: string | (string | string[])[];
                    label: string;
                    platformType?: undefined;
                    type?: undefined;
                    [key: string]: unknown;
                };
            };
        },
    >

    Localized project settings contribution info or undefined