@vscode/markdown-editor 0.0.2-8 → 0.0.2-80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -0
- package/dist/commands.d.ts +65 -0
- package/dist/commands.js +159 -0
- package/dist/commands.js.map +1 -0
- package/dist/config-BGeaJqWk.js +286 -0
- package/dist/config-BGeaJqWk.js.map +1 -0
- package/dist/config.d.ts +10 -0
- package/dist/config.js +6 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +1600 -119
- package/dist/index.js +6453 -2076
- package/dist/index.js.map +1 -1
- package/dist/markdown-editor.css +1 -0
- package/dist/stringEdit-CVDbCUBY.js +215 -0
- package/dist/stringEdit-CVDbCUBY.js.map +1 -0
- package/dist/web-editors.d.ts +282 -0
- package/dist/web-editors.js +7310 -0
- package/dist/web-editors.js.map +1 -0
- package/package.json +56 -16
- package/src/contrib/comments/commentInput.css +150 -0
- package/src/contrib/comments/comments.css +129 -0
- package/src/contrib/commentsVscode/vscodeCommentWidgetV2.css +171 -0
- package/src/contrib/find/find.css +347 -0
- package/src/view/editor.css +1157 -31
- package/src/view/themes/default.css +13 -4
- package/src/view/themes/github.css +16 -13
- package/src/view/themes/vscode-default.css +397 -0
- package/src/view/themes/{vscode.css → vscode-github.css} +124 -62
- package/dist/_observables/assert.d.ts +0 -2
- package/dist/_observables/deps.d.ts +0 -28
- package/dist/_observables/disposables.d.ts +0 -19
- package/dist/_observables/equals.d.ts +0 -32
- package/dist/_observables/index.d.ts +0 -2
- package/dist/_observables/observableInternal/base.d.ts +0 -172
- package/dist/_observables/observableInternal/changeTracker.d.ts +0 -44
- package/dist/_observables/observableInternal/commonFacade/cancellation.d.ts +0 -24
- package/dist/_observables/observableInternal/commonFacade/deps.d.ts +0 -24
- package/dist/_observables/observableInternal/debugLocation.d.ts +0 -21
- package/dist/_observables/observableInternal/debugName.d.ts +0 -33
- package/dist/_observables/observableInternal/experimental/deferUnobserve.d.ts +0 -16
- package/dist/_observables/observableInternal/experimental/reducer.d.ts +0 -37
- package/dist/_observables/observableInternal/experimental/utils.d.ts +0 -15
- package/dist/_observables/observableInternal/index.d.ts +0 -25
- package/dist/_observables/observableInternal/logging/consoleObservableLogger.d.ts +0 -40
- package/dist/_observables/observableInternal/logging/debugGetDependencyGraph.d.ts +0 -4
- package/dist/_observables/observableInternal/logging/debugger/debuggerRpc.d.ts +0 -4
- package/dist/_observables/observableInternal/logging/debugger/devToolsLogger.d.ts +0 -43
- package/dist/_observables/observableInternal/logging/debugger/rpc.d.ts +0 -41
- package/dist/_observables/observableInternal/logging/debugger/utils.d.ts +0 -13
- package/dist/_observables/observableInternal/logging/logging.d.ts +0 -30
- package/dist/_observables/observableInternal/map.d.ts +0 -18
- package/dist/_observables/observableInternal/observables/baseObservable.d.ts +0 -58
- package/dist/_observables/observableInternal/observables/constObservable.d.ts +0 -5
- package/dist/_observables/observableInternal/observables/derived.d.ts +0 -46
- package/dist/_observables/observableInternal/observables/derivedImpl.d.ts +0 -83
- package/dist/_observables/observableInternal/observables/lazyObservableValue.d.ts +0 -27
- package/dist/_observables/observableInternal/observables/observableFromEvent.d.ts +0 -37
- package/dist/_observables/observableInternal/observables/observableSignal.d.ts +0 -11
- package/dist/_observables/observableInternal/observables/observableSignalFromEvent.d.ts +0 -5
- package/dist/_observables/observableInternal/observables/observableValue.d.ts +0 -37
- package/dist/_observables/observableInternal/observables/observableValueOpts.d.ts +0 -8
- package/dist/_observables/observableInternal/reactions/autorun.d.ts +0 -56
- package/dist/_observables/observableInternal/reactions/autorunImpl.d.ts +0 -53
- package/dist/_observables/observableInternal/set.d.ts +0 -17
- package/dist/_observables/observableInternal/transaction.d.ts +0 -27
- package/dist/_observables/observableInternal/utils/promise.d.ts +0 -75
- package/dist/_observables/observableInternal/utils/runOnChange.d.ts +0 -7
- package/dist/_observables/observableInternal/utils/utils.d.ts +0 -43
- package/dist/_observables/observableInternal/utils/utilsCancellation.d.ts +0 -10
- package/dist/_observables/observableInternal/utils/valueWithChangeEvent.d.ts +0 -10
- package/dist/_observables/utils.d.ts +0 -15
- package/dist/observables.d.ts +0 -4
- package/dist/observables.js +0 -439
- package/dist/observables.js.map +0 -1
- package/dist/runOnChange-C00UIwqQ.js +0 -1538
- package/dist/runOnChange-C00UIwqQ.js.map +0 -1
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { IObservableWithChange, IReader } from './base';
|
|
2
|
-
export interface IChangeTracker<TChangeSummary> {
|
|
3
|
-
createChangeSummary(previousChangeSummary: TChangeSummary | undefined): TChangeSummary;
|
|
4
|
-
handleChange(ctx: IChangeContext, change: TChangeSummary): boolean;
|
|
5
|
-
beforeUpdate?(reader: IReader, change: TChangeSummary): void;
|
|
6
|
-
}
|
|
7
|
-
export interface IChangeContext {
|
|
8
|
-
readonly changedObservable: IObservableWithChange<any, any>;
|
|
9
|
-
readonly change: unknown;
|
|
10
|
-
/**
|
|
11
|
-
* Returns if the given observable caused the change.
|
|
12
|
-
*/
|
|
13
|
-
didChange<T, TChange>(observable: IObservableWithChange<T, TChange>): this is {
|
|
14
|
-
change: TChange;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Subscribes to and records changes and the last value of the given observables.
|
|
19
|
-
* Don't use the key "changes", as it is reserved for the changes array!
|
|
20
|
-
*/
|
|
21
|
-
export declare function recordChanges<TObs extends Record<any, IObservableWithChange<any, any>>>(obs: TObs): IChangeTracker<{
|
|
22
|
-
[TKey in keyof TObs]: ReturnType<TObs[TKey]['get']>;
|
|
23
|
-
} & {
|
|
24
|
-
changes: readonly ({
|
|
25
|
-
[TKey in keyof TObs]: {
|
|
26
|
-
key: TKey;
|
|
27
|
-
change: TObs[TKey]['TChange'];
|
|
28
|
-
};
|
|
29
|
-
}[keyof TObs])[];
|
|
30
|
-
}>;
|
|
31
|
-
/**
|
|
32
|
-
* Subscribes to and records changes and the last value of the given observables.
|
|
33
|
-
* Don't use the key "changes", as it is reserved for the changes array!
|
|
34
|
-
*/
|
|
35
|
-
export declare function recordChangesLazy<TObs extends Record<any, IObservableWithChange<any, any>>>(getObs: () => TObs): IChangeTracker<{
|
|
36
|
-
[TKey in keyof TObs]: ReturnType<TObs[TKey]['get']>;
|
|
37
|
-
} & {
|
|
38
|
-
changes: readonly ({
|
|
39
|
-
[TKey in keyof TObs]: {
|
|
40
|
-
key: TKey;
|
|
41
|
-
change: TObs[TKey]['TChange'];
|
|
42
|
-
};
|
|
43
|
-
}[keyof TObs])[];
|
|
44
|
-
}>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export declare class CancellationError extends Error {
|
|
2
|
-
constructor(message?: string);
|
|
3
|
-
}
|
|
4
|
-
export interface CancellationToken {
|
|
5
|
-
readonly isCancellationRequested: boolean;
|
|
6
|
-
readonly onCancellationRequested: (listener: () => void) => {
|
|
7
|
-
dispose: () => void;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
export declare class CancellationTokenSource {
|
|
11
|
-
private _isCancelled;
|
|
12
|
-
private _listeners;
|
|
13
|
-
get token(): CancellationToken;
|
|
14
|
-
cancel(): void;
|
|
15
|
-
dispose(): void;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Creates a CancellationToken that is cancelled when the given disposable is disposed.
|
|
19
|
-
*/
|
|
20
|
-
export declare function cancelOnDispose(disposable: {
|
|
21
|
-
add: (d: {
|
|
22
|
-
dispose: () => void;
|
|
23
|
-
}) => void;
|
|
24
|
-
}): CancellationToken;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { IDisposable } from '../../disposables';
|
|
2
|
-
export { DisposableStore, IDisposable } from '../../disposables';
|
|
3
|
-
export declare function markAsDisposed(_obj: any): void;
|
|
4
|
-
export declare function trackDisposable(_obj: any): void;
|
|
5
|
-
export declare function assertFn(_condition: () => boolean): void;
|
|
6
|
-
export declare function toDisposable(fn: () => void): IDisposable;
|
|
7
|
-
export declare class BugIndicatingError extends Error {
|
|
8
|
-
constructor(message?: string);
|
|
9
|
-
}
|
|
10
|
-
export declare function onBugIndicatingError(error: any): void;
|
|
11
|
-
export declare function onUnexpectedError(error: any): void;
|
|
12
|
-
export type EqualityComparer<T> = (a: T, b: T) => boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Compares two items for equality using strict equality.
|
|
15
|
-
*/
|
|
16
|
-
export declare const strictEquals: EqualityComparer<any>;
|
|
17
|
-
export interface IValueWithChangeEvent<T> {
|
|
18
|
-
readonly onDidChange: Event<void>;
|
|
19
|
-
get value(): T;
|
|
20
|
-
}
|
|
21
|
-
export interface Event<T> {
|
|
22
|
-
(listener: (e: T) => any, thisArgs?: any): IDisposable;
|
|
23
|
-
}
|
|
24
|
-
export declare function isDefined<T>(arg: T | undefined | null): arg is T;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export type DebugLocation = DebugLocationImpl | undefined;
|
|
2
|
-
export declare namespace DebugLocation {
|
|
3
|
-
function enable(): void;
|
|
4
|
-
function ofCaller(): DebugLocation;
|
|
5
|
-
function ofNthCaller(n: number): DebugLocation;
|
|
6
|
-
}
|
|
7
|
-
declare class DebugLocationImpl implements ILocation {
|
|
8
|
-
readonly fileName: string;
|
|
9
|
-
readonly line: number;
|
|
10
|
-
readonly column: number;
|
|
11
|
-
readonly id: string;
|
|
12
|
-
static fromStack(stack: string, parentIdx: number): DebugLocationImpl | undefined;
|
|
13
|
-
constructor(fileName: string, line: number, column: number, id: string);
|
|
14
|
-
}
|
|
15
|
-
export interface ILocation {
|
|
16
|
-
fileName: string;
|
|
17
|
-
line: number;
|
|
18
|
-
column: number;
|
|
19
|
-
id: string;
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export interface IDebugNameData {
|
|
2
|
-
/**
|
|
3
|
-
* The owner object of an observable.
|
|
4
|
-
* Used for debugging only, such as computing a name for the observable by iterating over the fields of the owner.
|
|
5
|
-
*/
|
|
6
|
-
readonly owner?: DebugOwner | undefined;
|
|
7
|
-
/**
|
|
8
|
-
* A string or function that returns a string that represents the name of the observable.
|
|
9
|
-
* Used for debugging only.
|
|
10
|
-
*/
|
|
11
|
-
readonly debugName?: DebugNameSource | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* A function that points to the defining function of the object.
|
|
14
|
-
* Used for debugging only.
|
|
15
|
-
*/
|
|
16
|
-
readonly debugReferenceFn?: Function | undefined;
|
|
17
|
-
}
|
|
18
|
-
export declare class DebugNameData {
|
|
19
|
-
readonly owner: DebugOwner | undefined;
|
|
20
|
-
readonly debugNameSource: DebugNameSource | undefined;
|
|
21
|
-
readonly referenceFn: Function | undefined;
|
|
22
|
-
constructor(owner: DebugOwner | undefined, debugNameSource: DebugNameSource | undefined, referenceFn: Function | undefined);
|
|
23
|
-
getDebugName(target: object): string | undefined;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* The owning object of an observable.
|
|
27
|
-
* Is only used for debugging purposes, such as computing a name for the observable by iterating over the fields of the owner.
|
|
28
|
-
*/
|
|
29
|
-
export type DebugOwner = object | undefined;
|
|
30
|
-
export type DebugNameSource = string | (() => string | undefined);
|
|
31
|
-
export declare function getDebugName(target: object, data: DebugNameData): string | undefined;
|
|
32
|
-
export declare function getClassName(obj: object): string | undefined;
|
|
33
|
-
export declare function getFunctionName(fn: Function): string | undefined;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { IObservable } from '../base';
|
|
2
|
-
import { DisposableStore } from '../commonFacade/deps';
|
|
3
|
-
/**
|
|
4
|
-
* Wraps an observable so that its source remains observed for a grace period
|
|
5
|
-
* after the wrapping observable loses all its observers.
|
|
6
|
-
*
|
|
7
|
-
* When the wrapping observable has observers, an autorun keeps `obs` observed
|
|
8
|
-
* and forwards changes. When the last observer is removed, `obs` stays observed
|
|
9
|
-
* via `keepObserved` for `maxIdleTimeMs` before being released. If a new observer
|
|
10
|
-
* arrives during the grace period, the keep-alive is cancelled seamlessly.
|
|
11
|
-
*
|
|
12
|
-
* @param store - Controls the hard lifetime; disposing it cancels any pending grace period.
|
|
13
|
-
* @param obs - The source observable to keep alive longer.
|
|
14
|
-
* @param maxIdleTimeMs - Grace period in milliseconds.
|
|
15
|
-
*/
|
|
16
|
-
export declare function deferUnobserve<T>(store: DisposableStore, obs: IObservable<T>, maxIdleTimeMs: number): IObservable<T>;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { EqualityComparer } from '../commonFacade/deps';
|
|
2
|
-
import { IObservable, IObservableWithChange, ISettableObservable } from '../base';
|
|
3
|
-
import { IChangeTracker } from '../changeTracker';
|
|
4
|
-
import { DebugOwner } from '../debugName';
|
|
5
|
-
import { IDerivedReader } from '../observables/derivedImpl';
|
|
6
|
-
export interface IReducerOptions<T, TChangeSummary = void, TOutChange = void> {
|
|
7
|
-
/**
|
|
8
|
-
* Is called to create the initial value of the observable when it becomes observed.
|
|
9
|
-
*/
|
|
10
|
-
initial: T | (() => T);
|
|
11
|
-
/**
|
|
12
|
-
* Is called to dispose the observable value when it is no longer observed.
|
|
13
|
-
*/
|
|
14
|
-
disposeFinal?(value: T): void;
|
|
15
|
-
changeTracker?: IChangeTracker<TChangeSummary>;
|
|
16
|
-
equalityComparer?: EqualityComparer<T>;
|
|
17
|
-
/**
|
|
18
|
-
* Applies the changes to the value.
|
|
19
|
-
* Use `reader.reportChange` to report change details or to report a change if the same value is returned.
|
|
20
|
-
*/
|
|
21
|
-
update(reader: IDerivedReader<TOutChange>, previousValue: T, changes: TChangeSummary): T;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Creates an observable value that is based on values and changes from other observables.
|
|
25
|
-
* Additionally, a reducer can report how that state changed.
|
|
26
|
-
*/
|
|
27
|
-
export declare function observableReducer<T, TInChanges, TOutChange = void>(owner: DebugOwner, options: IReducerOptions<T, TInChanges, TOutChange>): SimplifyObservableWithChange<T, TOutChange>;
|
|
28
|
-
/**
|
|
29
|
-
* Creates an observable value that is based on values and changes from other observables.
|
|
30
|
-
* Additionally, a reducer can report how that state changed.
|
|
31
|
-
*/
|
|
32
|
-
export declare function observableReducerSettable<T, TInChanges, TOutChange = void>(owner: DebugOwner, options: IReducerOptions<T, TInChanges, TOutChange>): ISettableObservable<T, TOutChange>;
|
|
33
|
-
/**
|
|
34
|
-
* Returns IObservable<T> if TChange is void, otherwise IObservableWithChange<T, TChange>
|
|
35
|
-
*/
|
|
36
|
-
type SimplifyObservableWithChange<T, TChange> = TChange extends void ? IObservable<T> : IObservableWithChange<T, TChange>;
|
|
37
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { IObservable, IReader } from '../base';
|
|
2
|
-
import { DebugOwner } from '../debugName';
|
|
3
|
-
/**
|
|
4
|
-
* Creates an observable that has the latest changed value of the given observables.
|
|
5
|
-
* Initially (and when not observed), it has the value of the last observable.
|
|
6
|
-
* When observed and any of the observables change, it has the value of the last changed observable.
|
|
7
|
-
* If multiple observables change in the same transaction, the last observable wins.
|
|
8
|
-
*/
|
|
9
|
-
export declare function latestChangedValue<T extends IObservable<any>[]>(owner: DebugOwner, observables: T): IObservable<ReturnType<T[number]['get']>>;
|
|
10
|
-
/**
|
|
11
|
-
* Works like a derived.
|
|
12
|
-
* However, if the value is not undefined, it is cached and will not be recomputed anymore.
|
|
13
|
-
* In that case, the derived will unsubscribe from its dependencies.
|
|
14
|
-
*/
|
|
15
|
-
export declare function derivedConstOnceDefined<T>(owner: DebugOwner, fn: (reader: IReader) => T): IObservable<T | undefined>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export { observableValueOpts } from './observables/observableValueOpts';
|
|
2
|
-
export { autorun, autorunDelta, autorunHandleChanges, autorunOpts, autorunWithStore, autorunWithStoreHandleChanges, autorunIterableDelta, autorunSelfDisposable } from './reactions/autorun';
|
|
3
|
-
export { type IObservable, type IObservableWithChange, type IObserver, type IReader, type ISettable, type ISettableObservable, type ITransaction } from './base';
|
|
4
|
-
export { disposableObservableValue } from './observables/observableValue';
|
|
5
|
-
export { derived, derivedDisposable, derivedHandleChanges, derivedOpts, derivedWithSetter, derivedWithStore } from './observables/derived';
|
|
6
|
-
export { type IDerivedReader } from './observables/derivedImpl';
|
|
7
|
-
export { ObservableLazy, ObservableLazyPromise, ObservablePromise, PromiseResult, } from './utils/promise';
|
|
8
|
-
export { derivedWithCancellationToken, waitForState } from './utils/utilsCancellation';
|
|
9
|
-
export { debouncedObservableDeprecated, debouncedObservable, derivedObservableWithCache, derivedObservableWithWritableCache, keepObserved, mapObservableArrayCached, observableFromPromise, recomputeInitiallyAndOnChange, signalFromObservable, wasEventTriggeredRecently, } from './utils/utils';
|
|
10
|
-
export { type DebugOwner } from './debugName';
|
|
11
|
-
export { type IChangeContext, type IChangeTracker, recordChanges, recordChangesLazy } from './changeTracker';
|
|
12
|
-
export { constObservable } from './observables/constObservable';
|
|
13
|
-
export { type IObservableSignal, observableSignal } from './observables/observableSignal';
|
|
14
|
-
export { observableFromEventOpts } from './observables/observableFromEvent';
|
|
15
|
-
export { observableSignalFromEvent } from './observables/observableSignalFromEvent';
|
|
16
|
-
export { asyncTransaction, globalTransaction, subtransaction, transaction, TransactionImpl } from './transaction';
|
|
17
|
-
export { observableFromValueWithChangeEvent, ValueWithChangeEventFromObservable } from './utils/valueWithChangeEvent';
|
|
18
|
-
export { runOnChange, runOnChangeWithCancellationToken, runOnChangeWithStore, type RemoveUndefined } from './utils/runOnChange';
|
|
19
|
-
export { derivedConstOnceDefined, latestChangedValue } from './experimental/utils';
|
|
20
|
-
export { deferUnobserve } from './experimental/deferUnobserve';
|
|
21
|
-
export { observableFromEvent } from './observables/observableFromEvent';
|
|
22
|
-
export { observableValue } from './observables/observableValue';
|
|
23
|
-
export { ObservableSet } from './set';
|
|
24
|
-
export { ObservableMap } from './map';
|
|
25
|
-
export { DebugLocation } from './debugLocation';
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { IObservable } from '../base';
|
|
2
|
-
import { TransactionImpl } from '../transaction';
|
|
3
|
-
import { IObservableLogger, IChangeInformation } from './logging';
|
|
4
|
-
import { FromEventObservable } from '../observables/observableFromEvent';
|
|
5
|
-
import { Derived } from '../observables/derivedImpl';
|
|
6
|
-
import { AutorunObserver } from '../reactions/autorunImpl';
|
|
7
|
-
export declare function logObservableToConsole(obs: IObservable<any>): void;
|
|
8
|
-
export declare class ConsoleObservableLogger implements IObservableLogger {
|
|
9
|
-
private indentation;
|
|
10
|
-
private _filteredObjects;
|
|
11
|
-
addFilteredObj(obj: unknown): void;
|
|
12
|
-
private _isIncluded;
|
|
13
|
-
private textToConsoleArgs;
|
|
14
|
-
private formatInfo;
|
|
15
|
-
handleObservableCreated(observable: IObservable<any>): void;
|
|
16
|
-
handleOnListenerCountChanged(observable: IObservable<any>, newCount: number): void;
|
|
17
|
-
handleObservableUpdated(observable: IObservable<unknown>, info: IChangeInformation): void;
|
|
18
|
-
private readonly changedObservablesSets;
|
|
19
|
-
formatChanges(changes: Set<IObservable<any>>): ConsoleText | undefined;
|
|
20
|
-
handleDerivedDependencyChanged(derived: Derived<any>, observable: IObservable<any>, change: unknown): void;
|
|
21
|
-
_handleDerivedRecomputed(derived: Derived<unknown>, info: IChangeInformation): void;
|
|
22
|
-
handleDerivedCleared(derived: Derived<unknown>): void;
|
|
23
|
-
handleFromEventObservableTriggered(observable: FromEventObservable<any, any>, info: IChangeInformation): void;
|
|
24
|
-
handleAutorunCreated(autorun: AutorunObserver): void;
|
|
25
|
-
handleAutorunDisposed(autorun: AutorunObserver): void;
|
|
26
|
-
handleAutorunDependencyChanged(autorun: AutorunObserver, observable: IObservable<any>, change: unknown): void;
|
|
27
|
-
handleAutorunStarted(autorun: AutorunObserver): void;
|
|
28
|
-
handleAutorunFinished(autorun: AutorunObserver): void;
|
|
29
|
-
handleBeginTransaction(transaction: TransactionImpl): void;
|
|
30
|
-
handleEndTransaction(): void;
|
|
31
|
-
}
|
|
32
|
-
type ConsoleText = (ConsoleText | undefined)[] | {
|
|
33
|
-
text: string;
|
|
34
|
-
style: string;
|
|
35
|
-
data?: unknown[];
|
|
36
|
-
} | {
|
|
37
|
-
data: unknown[];
|
|
38
|
-
};
|
|
39
|
-
export declare function formatValue(value: unknown, availableLen: number): string;
|
|
40
|
-
export {};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { AutorunObserver } from '../../reactions/autorunImpl';
|
|
2
|
-
import { TransactionImpl } from '../../transaction';
|
|
3
|
-
import { IChangeInformation, IObservableLogger } from '../logging';
|
|
4
|
-
import { IObservable } from '../../base';
|
|
5
|
-
import { Derived } from '../../observables/derivedImpl';
|
|
6
|
-
import { DebugLocation } from '../../debugLocation';
|
|
7
|
-
export declare class DevToolsLogger implements IObservableLogger {
|
|
8
|
-
private static _instance;
|
|
9
|
-
static getInstance(): DevToolsLogger;
|
|
10
|
-
private _declarationId;
|
|
11
|
-
private _instanceId;
|
|
12
|
-
private readonly _declarations;
|
|
13
|
-
private readonly _instanceInfos;
|
|
14
|
-
private readonly _aliveInstances;
|
|
15
|
-
private readonly _activeTransactions;
|
|
16
|
-
private readonly _channel;
|
|
17
|
-
private getTransactionState;
|
|
18
|
-
private _getObservableInfo;
|
|
19
|
-
private _getAutorunInfo;
|
|
20
|
-
private _getInfo;
|
|
21
|
-
private _formatObservable;
|
|
22
|
-
private _formatObserver;
|
|
23
|
-
private constructor();
|
|
24
|
-
private _pendingChanges;
|
|
25
|
-
private readonly _changeThrottler;
|
|
26
|
-
private readonly _fullState;
|
|
27
|
-
private _handleChange;
|
|
28
|
-
private readonly _flushUpdates;
|
|
29
|
-
private _getDeclarationId;
|
|
30
|
-
handleObservableCreated(observable: IObservable<any>, location: DebugLocation): void;
|
|
31
|
-
handleOnListenerCountChanged(observable: IObservable<any>, newCount: number): void;
|
|
32
|
-
handleObservableUpdated(observable: IObservable<any>, changeInfo: IChangeInformation): void;
|
|
33
|
-
handleAutorunCreated(autorun: AutorunObserver, location: DebugLocation): void;
|
|
34
|
-
handleAutorunDisposed(autorun: AutorunObserver): void;
|
|
35
|
-
handleAutorunDependencyChanged(autorun: AutorunObserver, observable: IObservable<any>, change: unknown): void;
|
|
36
|
-
handleAutorunStarted(autorun: AutorunObserver): void;
|
|
37
|
-
handleAutorunFinished(autorun: AutorunObserver): void;
|
|
38
|
-
handleDerivedDependencyChanged(derived: Derived<any>, observable: IObservable<any>, change: unknown): void;
|
|
39
|
-
_handleDerivedRecomputed(observable: Derived<any>, changeInfo: IChangeInformation): void;
|
|
40
|
-
handleDerivedCleared(observable: Derived<any>): void;
|
|
41
|
-
handleBeginTransaction(transaction: TransactionImpl): void;
|
|
42
|
-
handleEndTransaction(transaction: TransactionImpl): void;
|
|
43
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export type ChannelFactory = (handler: IChannelHandler) => IChannel;
|
|
2
|
-
export interface IChannel {
|
|
3
|
-
sendNotification(data: unknown): void;
|
|
4
|
-
sendRequest(data: unknown): Promise<RpcRequestResult>;
|
|
5
|
-
}
|
|
6
|
-
export interface IChannelHandler {
|
|
7
|
-
handleNotification(notificationData: unknown): void;
|
|
8
|
-
handleRequest(requestData: unknown): Promise<RpcRequestResult> | RpcRequestResult;
|
|
9
|
-
}
|
|
10
|
-
export type RpcRequestResult = {
|
|
11
|
-
type: 'result';
|
|
12
|
-
value: unknown;
|
|
13
|
-
} | {
|
|
14
|
-
type: 'error';
|
|
15
|
-
value: unknown;
|
|
16
|
-
};
|
|
17
|
-
export type API = {
|
|
18
|
-
host: Side;
|
|
19
|
-
client: Side;
|
|
20
|
-
};
|
|
21
|
-
export type Side = {
|
|
22
|
-
notifications: Record<string, (...args: any[]) => void>;
|
|
23
|
-
requests: Record<string, (...args: any[]) => Promise<unknown> | unknown>;
|
|
24
|
-
};
|
|
25
|
-
type MakeAsyncIfNot<TFn> = TFn extends (...args: infer TArgs) => infer TResult ? TResult extends Promise<unknown> ? TFn : (...args: TArgs) => Promise<TResult> : never;
|
|
26
|
-
export type MakeSideAsync<T extends Side> = {
|
|
27
|
-
notifications: T['notifications'];
|
|
28
|
-
requests: {
|
|
29
|
-
[K in keyof T['requests']]: MakeAsyncIfNot<T['requests'][K]>;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
export declare class SimpleTypedRpcConnection<T extends Side> {
|
|
33
|
-
private readonly _channelFactory;
|
|
34
|
-
private readonly _getHandler;
|
|
35
|
-
static createHost<T extends API>(channelFactory: ChannelFactory, getHandler: () => T['host']): SimpleTypedRpcConnection<MakeSideAsync<T['client']>>;
|
|
36
|
-
static createClient<T extends API>(channelFactory: ChannelFactory, getHandler: () => T['client']): SimpleTypedRpcConnection<MakeSideAsync<T['host']>>;
|
|
37
|
-
readonly api: T;
|
|
38
|
-
private readonly _channel;
|
|
39
|
-
private constructor();
|
|
40
|
-
}
|
|
41
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { IDisposable } from '../../../disposables';
|
|
2
|
-
export declare class Debouncer implements IDisposable {
|
|
3
|
-
private _timeout;
|
|
4
|
-
debounce(fn: () => void, timeoutMs: number): void;
|
|
5
|
-
dispose(): void;
|
|
6
|
-
}
|
|
7
|
-
export declare class Throttler implements IDisposable {
|
|
8
|
-
private _timeout;
|
|
9
|
-
throttle(fn: () => void, timeoutMs: number): void;
|
|
10
|
-
dispose(): void;
|
|
11
|
-
}
|
|
12
|
-
export declare function deepAssign<T>(target: T, source: T): void;
|
|
13
|
-
export declare function deepAssignDeleteNulls<T>(target: T, source: T): void;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { AutorunObserver } from '../reactions/autorunImpl';
|
|
2
|
-
import { IObservable } from '../base';
|
|
3
|
-
import { TransactionImpl } from '../transaction';
|
|
4
|
-
import type { Derived } from '../observables/derivedImpl';
|
|
5
|
-
import { DebugLocation } from '../debugLocation';
|
|
6
|
-
export declare function addLogger(logger: IObservableLogger): void;
|
|
7
|
-
export declare function getLogger(): IObservableLogger | undefined;
|
|
8
|
-
export declare function setLogObservableFn(fn: (obs: IObservable<any>) => void): void;
|
|
9
|
-
export declare function logObservable(obs: IObservable<any>): void;
|
|
10
|
-
export interface IChangeInformation {
|
|
11
|
-
oldValue: unknown;
|
|
12
|
-
newValue: unknown;
|
|
13
|
-
change: unknown;
|
|
14
|
-
didChange: boolean;
|
|
15
|
-
hadValue: boolean;
|
|
16
|
-
}
|
|
17
|
-
export interface IObservableLogger {
|
|
18
|
-
handleObservableCreated(observable: IObservable<any>, location: DebugLocation): void;
|
|
19
|
-
handleOnListenerCountChanged(observable: IObservable<any>, newCount: number): void;
|
|
20
|
-
handleObservableUpdated(observable: IObservable<any>, info: IChangeInformation): void;
|
|
21
|
-
handleAutorunCreated(autorun: AutorunObserver, location: DebugLocation): void;
|
|
22
|
-
handleAutorunDisposed(autorun: AutorunObserver): void;
|
|
23
|
-
handleAutorunDependencyChanged(autorun: AutorunObserver, observable: IObservable<any>, change: unknown): void;
|
|
24
|
-
handleAutorunStarted(autorun: AutorunObserver): void;
|
|
25
|
-
handleAutorunFinished(autorun: AutorunObserver): void;
|
|
26
|
-
handleDerivedDependencyChanged(derived: Derived<any, any, any>, observable: IObservable<any>, change: unknown): void;
|
|
27
|
-
handleDerivedCleared(observable: Derived<any, any, any>): void;
|
|
28
|
-
handleBeginTransaction(transaction: TransactionImpl): void;
|
|
29
|
-
handleEndTransaction(transaction: TransactionImpl): void;
|
|
30
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { IObservable, ITransaction } from './base';
|
|
2
|
-
export declare class ObservableMap<K, V> implements Map<K, V> {
|
|
3
|
-
private readonly _data;
|
|
4
|
-
private readonly _obs;
|
|
5
|
-
readonly observable: IObservable<Map<K, V>>;
|
|
6
|
-
get size(): number;
|
|
7
|
-
has(key: K): boolean;
|
|
8
|
-
get(key: K): V | undefined;
|
|
9
|
-
set(key: K, value: V, tx?: ITransaction): this;
|
|
10
|
-
delete(key: K, tx?: ITransaction): boolean;
|
|
11
|
-
clear(tx?: ITransaction): void;
|
|
12
|
-
forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;
|
|
13
|
-
entries(): IterableIterator<[K, V]>;
|
|
14
|
-
keys(): IterableIterator<K>;
|
|
15
|
-
values(): IterableIterator<V>;
|
|
16
|
-
[Symbol.iterator](): IterableIterator<[K, V]>;
|
|
17
|
-
get [Symbol.toStringTag](): string;
|
|
18
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { IObservableWithChange, IObserver, IReader, IObservable } from '../base';
|
|
2
|
-
import { DisposableStore } from '../commonFacade/deps';
|
|
3
|
-
import { DebugLocation } from '../debugLocation';
|
|
4
|
-
import { DebugOwner } from '../debugName';
|
|
5
|
-
import { debugGetDependencyGraph } from '../logging/debugGetDependencyGraph';
|
|
6
|
-
import type { keepObserved, recomputeInitiallyAndOnChange } from '../utils/utils';
|
|
7
|
-
import { derivedOpts } from './derived';
|
|
8
|
-
declare let _derived: typeof derivedOpts;
|
|
9
|
-
/**
|
|
10
|
-
* @internal
|
|
11
|
-
* This is to allow splitting files.
|
|
12
|
-
*/
|
|
13
|
-
export declare function _setDerivedOpts(derived: typeof _derived): void;
|
|
14
|
-
declare let _recomputeInitiallyAndOnChange: typeof recomputeInitiallyAndOnChange;
|
|
15
|
-
export declare function _setRecomputeInitiallyAndOnChange(recomputeInitiallyAndOnChange: typeof _recomputeInitiallyAndOnChange): void;
|
|
16
|
-
declare let _keepObserved: typeof keepObserved;
|
|
17
|
-
export declare function _setKeepObserved(keepObserved: typeof _keepObserved): void;
|
|
18
|
-
declare let _debugGetDependencyGraph: typeof debugGetDependencyGraph;
|
|
19
|
-
export declare function _setDebugGetDependencyGraph(debugGetDependencyGraph: typeof _debugGetDependencyGraph): void;
|
|
20
|
-
export declare abstract class ConvenientObservable<T, TChange> implements IObservableWithChange<T, TChange> {
|
|
21
|
-
get TChange(): TChange;
|
|
22
|
-
abstract get(): T;
|
|
23
|
-
reportChanges(): void;
|
|
24
|
-
abstract addObserver(observer: IObserver): void;
|
|
25
|
-
abstract removeObserver(observer: IObserver): void;
|
|
26
|
-
/** @sealed */
|
|
27
|
-
read(reader: IReader | undefined): T;
|
|
28
|
-
/** @sealed */
|
|
29
|
-
map<TNew>(fn: (value: T, reader: IReader) => TNew): IObservable<TNew>;
|
|
30
|
-
map<TNew>(owner: DebugOwner, fn: (value: T, reader: IReader) => TNew): IObservable<TNew>;
|
|
31
|
-
abstract log(): IObservableWithChange<T, TChange>;
|
|
32
|
-
/**
|
|
33
|
-
* @sealed
|
|
34
|
-
* Converts an observable of an observable value into a direct observable of the value.
|
|
35
|
-
*/
|
|
36
|
-
flatten<TNew>(this: IObservable<IObservableWithChange<TNew, any>>): IObservable<TNew>;
|
|
37
|
-
recomputeInitiallyAndOnChange(store: DisposableStore, handleValue?: (value: T) => void): IObservable<T>;
|
|
38
|
-
/**
|
|
39
|
-
* Ensures that this observable is observed. This keeps the cache alive.
|
|
40
|
-
* However, in case of deriveds, it does not force eager evaluation (only when the value is read/get).
|
|
41
|
-
* Use `recomputeInitiallyAndOnChange` for eager evaluation.
|
|
42
|
-
*/
|
|
43
|
-
keepObserved(store: DisposableStore): IObservable<T>;
|
|
44
|
-
abstract get debugName(): string;
|
|
45
|
-
protected get debugValue(): T;
|
|
46
|
-
debugGetDependencyGraph(): string;
|
|
47
|
-
}
|
|
48
|
-
export declare abstract class BaseObservable<T, TChange = void> extends ConvenientObservable<T, TChange> {
|
|
49
|
-
protected readonly _observers: Set<IObserver>;
|
|
50
|
-
constructor(debugLocation: DebugLocation);
|
|
51
|
-
addObserver(observer: IObserver): void;
|
|
52
|
-
removeObserver(observer: IObserver): void;
|
|
53
|
-
protected onFirstObserverAdded(): void;
|
|
54
|
-
protected onLastObserverRemoved(): void;
|
|
55
|
-
log(): IObservableWithChange<T, TChange>;
|
|
56
|
-
debugGetObservers(): Set<IObserver>;
|
|
57
|
-
}
|
|
58
|
-
export {};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { IObservable, IReader, ITransaction, ISettableObservable, IObservableWithChange } from '../base';
|
|
2
|
-
import { IChangeTracker } from '../changeTracker';
|
|
3
|
-
import { DisposableStore, EqualityComparer, IDisposable } from '../commonFacade/deps';
|
|
4
|
-
import { DebugLocation } from '../debugLocation';
|
|
5
|
-
import { DebugOwner, IDebugNameData } from '../debugName';
|
|
6
|
-
import { IDerivedReader } from './derivedImpl';
|
|
7
|
-
/**
|
|
8
|
-
* Creates an observable that is derived from other observables.
|
|
9
|
-
* The value is only recomputed when absolutely needed.
|
|
10
|
-
*
|
|
11
|
-
* {@link computeFn} should start with a JS Doc using `@description` to name the derived.
|
|
12
|
-
*/
|
|
13
|
-
export declare function derived<T, TChange = void>(computeFn: (reader: IDerivedReader<TChange>) => T): IObservableWithChange<T, TChange>;
|
|
14
|
-
export declare function derived<T, TChange = void>(owner: DebugOwner, computeFn: (reader: IDerivedReader<TChange>) => T): IObservableWithChange<T, TChange>;
|
|
15
|
-
export declare function derivedWithSetter<T>(owner: DebugOwner | undefined, computeFn: (reader: IReader) => T, setter: (value: T, transaction: ITransaction | undefined) => void, debugLocation?: DebugLocation): ISettableObservable<T>;
|
|
16
|
-
export declare function derivedOpts<T>(options: IDebugNameData & {
|
|
17
|
-
equalsFn?: EqualityComparer<T>;
|
|
18
|
-
onLastObserverRemoved?: (() => void);
|
|
19
|
-
}, computeFn: (reader: IReader) => T, debugLocation?: DebugLocation): IObservable<T>;
|
|
20
|
-
/**
|
|
21
|
-
* Represents an observable that is derived from other observables.
|
|
22
|
-
* The value is only recomputed when absolutely needed.
|
|
23
|
-
*
|
|
24
|
-
* {@link computeFn} should start with a JS Doc using `@description` to name the derived.
|
|
25
|
-
*
|
|
26
|
-
* Use `createEmptyChangeSummary` to create a "change summary" that can collect the changes.
|
|
27
|
-
* Use `handleChange` to add a reported change to the change summary.
|
|
28
|
-
* The compute function is given the last change summary.
|
|
29
|
-
* The change summary is discarded after the compute function was called.
|
|
30
|
-
*
|
|
31
|
-
* @see derived
|
|
32
|
-
*/
|
|
33
|
-
export declare function derivedHandleChanges<T, TDelta, TChangeSummary>(options: IDebugNameData & {
|
|
34
|
-
changeTracker: IChangeTracker<TChangeSummary>;
|
|
35
|
-
equalityComparer?: EqualityComparer<T>;
|
|
36
|
-
}, computeFn: (reader: IDerivedReader<TDelta>, changeSummary: TChangeSummary) => T, debugLocation?: DebugLocation): IObservableWithChange<T, TDelta>;
|
|
37
|
-
/**
|
|
38
|
-
* @deprecated Use `derived(reader => { reader.store.add(...) })` instead!
|
|
39
|
-
*/
|
|
40
|
-
export declare function derivedWithStore<T>(computeFn: (reader: IReader, store: DisposableStore) => T): IObservable<T>;
|
|
41
|
-
/**
|
|
42
|
-
* @deprecated Use `derived(reader => { reader.store.add(...) })` instead!
|
|
43
|
-
*/
|
|
44
|
-
export declare function derivedWithStore<T>(owner: DebugOwner, computeFn: (reader: IReader, store: DisposableStore) => T): IObservable<T>;
|
|
45
|
-
export declare function derivedDisposable<T extends IDisposable | undefined>(computeFn: (reader: IReader) => T): IObservable<T>;
|
|
46
|
-
export declare function derivedDisposable<T extends IDisposable | undefined>(owner: DebugOwner, computeFn: (reader: IReader) => T): IObservable<T>;
|