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

interface IProjectSettingsService {
    getDefault<ProjectSettingName>(key: ProjectSettingName): Promise<ProjectSettingTypes[ProjectSettingName]>;
    getLocalizedContributionInfo(): Promise<undefined | {
        contributions: {};
        settings: {
            platform.fullName: undefined | {
                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;
            };
            platform.isEditable: undefined | {
                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;
            };
            platform.language: undefined | {
                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;
            };
            platform.name: undefined | {
                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;
            };
        };
    }>;
    isValid<ProjectSettingName>(key: ProjectSettingName, newValue: ProjectSettingTypes[ProjectSettingName], currentValue: ProjectSettingTypes[ProjectSettingName], allChanges?: SimultaneousProjectSettingsChanges): Promise<boolean>;
    registerValidator<ProjectSettingName>(key: ProjectSettingName, validatorCallback: ProjectSettingValidator<ProjectSettingName>): Promise<UnsubscriberAsync>;
}

Methods

  • Gets default value for a project setting

    Every Project Data Providers must run this function when it receives a request to get a project setting if the project does not have a value for the project setting requested. It should return the response from this function directly, either the returned default value or throw.

    Type Parameters

    Parameters

    Returns Promise<ProjectSettingTypes[ProjectSettingName]>

    The default value for the setting if a default value is registered

    If a default value is not registered for the setting

  • 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: {};
        settings: {
            platform.fullName: undefined | {
                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;
            };
            platform.isEditable: undefined | {
                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;
            };
            platform.language: undefined | {
                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;
            };
            platform.name: undefined | {
                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;
            };
        };
    }>

    Localized project settings contribution info or undefined