UNPKG

1.91 kBTypeScriptView Raw
1import { JSONValue } from '@phosphor/coreutils';
2import { IJSONSchema } from '../json-schema';
3import { PreferenceScope } from './preference-scope';
4export interface PreferenceSchema {
5 [name: string]: any;
6 scope?: 'application' | 'window' | 'resource' | PreferenceScope;
7 overridable?: boolean;
8 properties: PreferenceSchemaProperties;
9}
10export declare namespace PreferenceSchema {
11 function is(obj: unknown): obj is PreferenceSchema;
12 function getDefaultScope(schema: PreferenceSchema): PreferenceScope;
13}
14export interface PreferenceSchemaProperties {
15 [name: string]: PreferenceSchemaProperty;
16}
17export declare namespace PreferenceSchemaProperties {
18 function is(obj: unknown): obj is PreferenceSchemaProperties;
19}
20export interface PreferenceDataSchema {
21 [name: string]: any;
22 scope?: PreferenceScope;
23 properties: {
24 [name: string]: PreferenceDataProperty;
25 };
26 patternProperties: {
27 [name: string]: PreferenceDataProperty;
28 };
29}
30export interface PreferenceItem extends IJSONSchema {
31 /**
32 * preference default value, if `undefined` then `default`
33 */
34 defaultValue?: JSONValue;
35 overridable?: boolean;
36 included?: boolean;
37 [key: string]: any;
38}
39export interface PreferenceSchemaProperty extends PreferenceItem {
40 description?: string;
41 markdownDescription?: string;
42 scope?: 'application' | 'machine' | 'window' | 'resource' | 'language-overridable' | 'machine-overridable' | PreferenceScope;
43}
44export interface PreferenceDataProperty extends PreferenceItem {
45 description?: string;
46 markdownDescription?: string;
47 scope?: PreferenceScope;
48 typeDetails?: any;
49}
50export declare namespace PreferenceDataProperty {
51 function fromPreferenceSchemaProperty(schemaProps: PreferenceSchemaProperty, defaultScope?: PreferenceScope): PreferenceDataProperty;
52}
53//# sourceMappingURL=preference-schema.d.ts.map
\No newline at end of file