UNPKG

3.46 kBTypeScriptView Raw
1import { PreferenceSchema } from '../../common/preferences/preference-schema';
2import { Disposable, DisposableCollection, Emitter, Event, MaybePromise } from '../../common';
3import { PreferenceChangeEvent, PreferenceEventEmitter, PreferenceProxy, PreferenceProxyOptions, PreferenceRetrieval } from './preference-proxy';
4import { PreferenceChange, PreferenceChangeImpl, PreferenceChanges, PreferenceService } from './preference-service';
5import { JSONValue } from '@phosphor/coreutils';
6import { PreferenceProviderDataChange } from './preference-provider';
7import { OverridePreferenceName } from './preference-language-override-service';
8export declare const PreferenceProxySchema: unique symbol;
9export interface PreferenceProxyFactory {
10 <T>(schema: MaybePromise<PreferenceSchema>, options?: PreferenceProxyOptions): PreferenceProxy<T>;
11}
12export declare const PreferenceProxyFactory: unique symbol;
13export declare class PreferenceProxyChange extends PreferenceChangeImpl {
14 protected readonly overrideIdentifier?: string | undefined;
15 constructor(change: PreferenceProviderDataChange, overrideIdentifier?: string | undefined);
16 affects(resourceUri?: string, overrideIdentifier?: string): boolean;
17}
18export declare class InjectablePreferenceProxy<T extends Record<string, JSONValue>> implements ProxyHandler<T>, ProxyHandler<Disposable>, ProxyHandler<PreferenceEventEmitter<T>>, ProxyHandler<PreferenceRetrieval<T>> {
19 protected readonly options: PreferenceProxyOptions;
20 protected readonly preferences: PreferenceService;
21 protected readonly promisedSchema: () => PreferenceSchema | Promise<PreferenceSchema>;
22 protected readonly factory: PreferenceProxyFactory;
23 protected toDispose: DisposableCollection;
24 protected _onPreferenceChangedEmitter: Emitter<PreferenceChangeEvent<T>> | undefined;
25 protected schema: PreferenceSchema | undefined;
26 protected get prefix(): string;
27 protected get style(): Required<PreferenceProxyOptions>['style'];
28 protected get resourceUri(): PreferenceProxyOptions['resourceUri'];
29 protected get overrideIdentifier(): PreferenceProxyOptions['overrideIdentifier'];
30 protected get isDeep(): boolean;
31 protected get isFlat(): boolean;
32 protected get onPreferenceChangedEmitter(): Emitter<PreferenceChangeEvent<T>>;
33 get onPreferenceChanged(): Event<PreferenceChangeEvent<T>>;
34 protected init(): void;
35 get(target: unknown, property: string, receiver: unknown): unknown;
36 set(target: unknown, property: string, value: unknown, receiver: unknown): boolean;
37 ownKeys(): string[];
38 getOwnPropertyDescriptor(target: unknown, property: string): PropertyDescriptor;
39 deleteProperty(): never;
40 defineProperty(): never;
41 toJSON(): JSONValue;
42 protected subscribeToChangeEvents(): void;
43 protected handlePreferenceChanges(changes: PreferenceChanges): void;
44 protected isRelevantChange(change: PreferenceChange, overrideInfo?: OverridePreferenceName): boolean;
45 protected fireChangeEvent(change: PreferenceChangeEvent<T>): void;
46 protected buildNewChangeEvent(change: PreferenceProviderDataChange, overrideInfo?: OverridePreferenceName): PreferenceChangeEvent<T>;
47 protected getValue<K extends keyof T & string>(preferenceIdentifier: K | OverridePreferenceName & {
48 preferenceName: K;
49 }, defaultValue: T[K], resourceUri?: string | undefined): T[K];
50 dispose(): void;
51}
52//# sourceMappingURL=injectable-preference-proxy.d.ts.map
\No newline at end of file