Component management improvements, removal of dependence on noteReady flag

This commit is contained in:
Mo Bitar
2020-04-15 10:26:55 -05:00
parent a2303aa7af
commit 0d44a2ff64
17 changed files with 1618 additions and 1119 deletions

View File

@@ -0,0 +1,29 @@
import { DeviceInterface, SNApplication } from 'snjs';
export declare class WebDeviceInterface extends DeviceInterface {
private database;
constructor(namespace: string, timeout: any);
setApplication(application: SNApplication): void;
deinit(): void;
getRawStorageValue(key: string): Promise<string | null>;
getAllRawStorageKeyValues(): Promise<{
key: string;
value: any;
}[]>;
setRawStorageValue(key: string, value: any): Promise<void>;
removeRawStorageValue(key: string): Promise<void>;
removeAllRawStorageValues(): Promise<void>;
openDatabase(): Promise<{
isNewDatabase?: boolean | undefined;
} | undefined>;
private getDatabaseKeyPrefix;
private keyForPayloadId;
getAllRawDatabasePayloads(): Promise<any[]>;
saveRawDatabasePayload(payload: any): Promise<void>;
saveRawDatabasePayloads(payloads: any[]): Promise<void>;
removeRawDatabasePayloadWithId(id: string): Promise<void>;
removeAllRawDatabasePayloads(): Promise<void>;
getKeychainValue(): Promise<any>;
setKeychainValue(value: any): Promise<void>;
clearKeychainValue(): Promise<void>;
openUrl(url: string): void;
}

View File

@@ -1,4 +1,5 @@
/// <reference types="angular" />
import { ComponentGroup } from './component_group';
import { EditorGroup } from '@/ui_models/editor_group';
import { PasswordWizardType } from '@/types';
import { SNApplication, Challenge, ChallengeOrchestrator, ProtectedAction } from 'snjs';
@@ -21,27 +22,19 @@ export declare class WebApplication extends SNApplication {
private webServices;
private currentAuthenticationElement?;
editorGroup: EditorGroup;
componentGroup: ComponentGroup;
constructor($compile: ng.ICompileService, $timeout: ng.ITimeoutService, scope: ng.IScope, onDeinit: (app: WebApplication) => void);
/** @override */
deinit(): void;
setWebServices(services: WebServices): void;
/** @access public */
getAppState(): AppState;
/** @access public */
getDesktopService(): DesktopManager;
/** @access public */
getLockService(): LockManager;
/** @access public */
getArchiveService(): ArchiveManager;
/** @access public */
getNativeExtService(): NativeExtManager;
/** @access public */
getStatusService(): StatusManager;
/** @access public */
getThemeService(): ThemeManager;
/** @access public */
getPrefsService(): PreferencesManager;
/** @access public */
getKeyboardService(): KeyboardManager;
checkForSecurityUpdate(): Promise<boolean>;
presentPasswordWizard(type: PasswordWizardType): void;

View File

@@ -0,0 +1,23 @@
import { SNComponent, ComponentArea } from 'snjs';
import { WebApplication } from './application';
export declare class ComponentGroup {
private application;
changeObservers: any[];
activeComponents: Partial<Record<string, SNComponent>>;
constructor(application: WebApplication);
get componentManager(): import("../../../../../snjs/dist/@types").SNComponentManager;
deinit(): void;
registerComponentHandler(): void;
activateComponent(component: SNComponent): Promise<void>;
deactivateComponent(component: SNComponent): Promise<void>;
deactivateComponentForArea(area: ComponentArea): Promise<void>;
activeComponentForArea(area: ComponentArea): SNComponent;
activeComponentsForArea(area: ComponentArea): SNComponent[];
allComponentsForArea(area: ComponentArea): SNComponent[];
private allActiveComponents;
/**
* Notifies observer when the active editor has changed.
*/
addChangeObserver(callback: any): void;
private notifyObservers;
}

View File

@@ -1,6 +1,6 @@
export declare function getParameterByName(name: string, url: string): string | null;
export declare function isNullOrUndefined(value: any): boolean;
export declare function dictToArray(dict: any): any[];
export declare function dictToArray<T>(dict: Record<any, T>): NonNullable<T>[];
export declare function getPlatformString(): string;
export declare function dateToLocalizedString(date: Date): string;
/** Via https://davidwalsh.name/javascript-debounce-function */

2113
dist/javascripts/app.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long