Incipient TypeScript
This commit is contained in:
1
.babelrc
1
.babelrc
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"presets": [
|
"presets": [
|
||||||
|
"@babel/typescript",
|
||||||
[
|
[
|
||||||
"@babel/preset-env",
|
"@babel/preset-env",
|
||||||
{
|
{
|
||||||
|
|||||||
1
app/assets/javascripts/@types/app/assets/javascripts/app.d.ts
vendored
Normal file
1
app/assets/javascripts/@types/app/assets/javascripts/app.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export {};
|
||||||
53
app/assets/javascripts/@types/app/assets/javascripts/application.d.ts
vendored
Normal file
53
app/assets/javascripts/@types/app/assets/javascripts/application.d.ts
vendored
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
import { PasswordWizardType } from './types';
|
||||||
|
import { SNApplication, Challenge, ChallengeOrchestrator, ProtectedAction } from 'snjs';
|
||||||
|
import { AppState, DesktopManager, LockManager, ArchiveManager, NativeExtManager, StatusManager, ThemeManager, PreferencesManager, KeyboardManager } from './services';
|
||||||
|
declare type WebServices = {
|
||||||
|
appState: AppState;
|
||||||
|
desktopService: DesktopManager;
|
||||||
|
lockService: LockManager;
|
||||||
|
archiveService: ArchiveManager;
|
||||||
|
nativeExtService: NativeExtManager;
|
||||||
|
statusService: StatusManager;
|
||||||
|
themeService: ThemeManager;
|
||||||
|
prefsService: PreferencesManager;
|
||||||
|
keyboardService: KeyboardManager;
|
||||||
|
};
|
||||||
|
export declare class WebApplication extends SNApplication {
|
||||||
|
private $compile?;
|
||||||
|
private scope?;
|
||||||
|
private onDeinit?;
|
||||||
|
private webServices;
|
||||||
|
private currentAuthenticationElement?;
|
||||||
|
constructor($compile: ng.ICompileService, $timeout: ng.ITimeoutService, scope: ng.IScope, onDeinit: () => 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;
|
||||||
|
promptForChallenge(challenge: Challenge, orchestrator: ChallengeOrchestrator): void;
|
||||||
|
performProtocolUpgrade(): Promise<void>;
|
||||||
|
presentPrivilegesModal(action: ProtectedAction, onSuccess: any, onCancel: any): Promise<void>;
|
||||||
|
presentPrivilegesManagementModal(): void;
|
||||||
|
authenticationInProgress(): boolean;
|
||||||
|
presentPasswordModal(callback: () => void): void;
|
||||||
|
presentRevisionPreviewModal(uuid: string, content: any): void;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
28
app/assets/javascripts/@types/app/assets/javascripts/applicationManager.d.ts
vendored
Normal file
28
app/assets/javascripts/@types/app/assets/javascripts/applicationManager.d.ts
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
export class ApplicationManager {
|
||||||
|
constructor($compile: any, $rootScope: any, $timeout: any);
|
||||||
|
$compile: any;
|
||||||
|
$timeout: any;
|
||||||
|
$rootScope: any;
|
||||||
|
applications: any[];
|
||||||
|
changeObservers: any[];
|
||||||
|
/** @callback */
|
||||||
|
onApplicationDeinit(application: any): void;
|
||||||
|
/** @access private */
|
||||||
|
createDefaultApplication(): void;
|
||||||
|
activeApplication: WebApplication | null | undefined;
|
||||||
|
/** @access private */
|
||||||
|
createNewApplication(): WebApplication;
|
||||||
|
get application(): WebApplication | null | undefined;
|
||||||
|
/** @access public */
|
||||||
|
getApplications(): any[];
|
||||||
|
/**
|
||||||
|
* Notifies observer when the active application has changed.
|
||||||
|
* Any application which is no longer active is destroyed, and
|
||||||
|
* must be removed from the interface.
|
||||||
|
* @access public
|
||||||
|
* @param {function} callback
|
||||||
|
*/
|
||||||
|
addApplicationChangeObserver(callback: Function): void;
|
||||||
|
notifyObserversOfAppChange(): void;
|
||||||
|
}
|
||||||
|
import { WebApplication } from "./application";
|
||||||
28
app/assets/javascripts/@types/app/assets/javascripts/controllers/abstract/pure_ctrl.d.ts
vendored
Normal file
28
app/assets/javascripts/@types/app/assets/javascripts/controllers/abstract/pure_ctrl.d.ts
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
export class PureCtrl {
|
||||||
|
constructor($timeout: any);
|
||||||
|
$timeout: any;
|
||||||
|
props: any;
|
||||||
|
state: any;
|
||||||
|
$onInit(): void;
|
||||||
|
deinit(): void;
|
||||||
|
unsubApp: any;
|
||||||
|
unsubState: any;
|
||||||
|
application: any;
|
||||||
|
$onDestroy(): void;
|
||||||
|
/** @private */
|
||||||
|
private resetState;
|
||||||
|
/** @override */
|
||||||
|
getInitialState(): {};
|
||||||
|
setState(state: any): Promise<any>;
|
||||||
|
stateTimeout: any;
|
||||||
|
initProps(props: any): void;
|
||||||
|
addAppStateObserver(): void;
|
||||||
|
onAppStateEvent(eventName: any, data: any): void;
|
||||||
|
addAppEventObserver(): void;
|
||||||
|
onAppEvent(eventName: any): void;
|
||||||
|
/** @override */
|
||||||
|
onAppStart(): Promise<void>;
|
||||||
|
onAppLaunch(): Promise<void>;
|
||||||
|
onAppKeyChange(): Promise<void>;
|
||||||
|
onAppSync(): void;
|
||||||
|
}
|
||||||
47
app/assets/javascripts/@types/app/assets/javascripts/controllers/applicationView.d.ts
vendored
Normal file
47
app/assets/javascripts/@types/app/assets/javascripts/controllers/applicationView.d.ts
vendored
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
export class ApplicationView {
|
||||||
|
template: any;
|
||||||
|
controller: typeof ApplicationViewCtrl;
|
||||||
|
replace: boolean;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: {
|
||||||
|
application: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
declare class ApplicationViewCtrl extends PureCtrl {
|
||||||
|
constructor($compile: any, $location: any, $rootScope: any, $timeout: any);
|
||||||
|
$location: any;
|
||||||
|
$rootScope: any;
|
||||||
|
$compile: any;
|
||||||
|
platformString: string;
|
||||||
|
state: {
|
||||||
|
appClass: string;
|
||||||
|
};
|
||||||
|
onDragDrop(event: any): void;
|
||||||
|
onDragOver(event: any): void;
|
||||||
|
openModalComponent(component: any): void;
|
||||||
|
presentPermissionsDialog(dialog: any): void;
|
||||||
|
lockScreenPuppet: any;
|
||||||
|
loadApplication(): Promise<void>;
|
||||||
|
onAppStart(): void;
|
||||||
|
onAppLaunch(): void;
|
||||||
|
onUpdateAvailable(): void;
|
||||||
|
/** @override */
|
||||||
|
onAppEvent(eventName: any): Promise<void>;
|
||||||
|
syncStatus: any;
|
||||||
|
completedInitialSync: boolean | undefined;
|
||||||
|
/** @override */
|
||||||
|
onAppStateEvent(eventName: any, data: any): Promise<void>;
|
||||||
|
notesCollapsed: any;
|
||||||
|
tagsCollapsed: any;
|
||||||
|
updateLocalDataStatus(): void;
|
||||||
|
updateSyncStatus(): void;
|
||||||
|
showingDownloadStatus: boolean | undefined;
|
||||||
|
uploadSyncStatus: any;
|
||||||
|
overrideComponentManagerFunctions(): void;
|
||||||
|
showInvalidSessionAlert(): void;
|
||||||
|
lastShownDate: Date | undefined;
|
||||||
|
addDragDropHandlers(): void;
|
||||||
|
handleAutoSignInFromParams(): Promise<void>;
|
||||||
|
}
|
||||||
|
import { PureCtrl } from "./abstract/pure_ctrl";
|
||||||
|
export {};
|
||||||
2
app/assets/javascripts/@types/app/assets/javascripts/controllers/constants.d.ts
vendored
Normal file
2
app/assets/javascripts/@types/app/assets/javascripts/controllers/constants.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export const PANEL_NAME_NOTES: "notes";
|
||||||
|
export const PANEL_NAME_TAGS: "tags";
|
||||||
122
app/assets/javascripts/@types/app/assets/javascripts/controllers/editor.d.ts
vendored
Normal file
122
app/assets/javascripts/@types/app/assets/javascripts/controllers/editor.d.ts
vendored
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
export class EditorPanel {
|
||||||
|
restrict: string;
|
||||||
|
scope: {
|
||||||
|
application: string;
|
||||||
|
};
|
||||||
|
template: any;
|
||||||
|
replace: boolean;
|
||||||
|
controller: typeof EditorCtrl;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: boolean;
|
||||||
|
}
|
||||||
|
declare class EditorCtrl {
|
||||||
|
constructor($timeout: any);
|
||||||
|
leftPanelPuppet: {
|
||||||
|
onReady: () => void;
|
||||||
|
};
|
||||||
|
rightPanelPuppet: {
|
||||||
|
onReady: () => void;
|
||||||
|
};
|
||||||
|
/** Used by .pug template */
|
||||||
|
prefKeyMonospace: string;
|
||||||
|
prefKeySpellcheck: string;
|
||||||
|
prefKeyMarginResizers: string;
|
||||||
|
deinit(): void;
|
||||||
|
/** @components */
|
||||||
|
onEditorLoad: (editor: any) => void;
|
||||||
|
unregisterComponent: any;
|
||||||
|
$onInit(): void;
|
||||||
|
/** @override */
|
||||||
|
getInitialState(): {
|
||||||
|
componentStack: never[];
|
||||||
|
editorDebounce: number;
|
||||||
|
isDesktop: any;
|
||||||
|
spellcheck: boolean;
|
||||||
|
mutable: {
|
||||||
|
tagsString: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
onAppLaunch(): void;
|
||||||
|
/** @override */
|
||||||
|
onAppStateEvent(eventName: any, data: any): void;
|
||||||
|
/** @override */
|
||||||
|
onAppEvent(eventName: any): void;
|
||||||
|
/**
|
||||||
|
* Because note.locked accesses note.content.appData,
|
||||||
|
* we do not want to expose the template to direct access to note.locked,
|
||||||
|
* otherwise an exception will occur when trying to access note.locked if the note
|
||||||
|
* is deleted. There is potential for race conditions to occur with setState, where a
|
||||||
|
* previous setState call may have queued a digest cycle, and the digest cycle triggers
|
||||||
|
* on a deleted note.
|
||||||
|
*/
|
||||||
|
get noteLocked(): any;
|
||||||
|
streamItems(): void;
|
||||||
|
handleNoteSelectionChange(note: any, previousNote: any): Promise<void>;
|
||||||
|
editorForNote(note: any): any;
|
||||||
|
setMenuState(menu: any, state: any): void;
|
||||||
|
toggleMenu(menu: any): void;
|
||||||
|
closeAllMenus({ exclude }?: {
|
||||||
|
exclude: any;
|
||||||
|
}): void;
|
||||||
|
editorMenuOnSelect: (component: any) => void;
|
||||||
|
hasAvailableExtensions(): boolean;
|
||||||
|
performFirefoxPinnedTabFix(): void;
|
||||||
|
saveNote({ bypassDebouncer, updateClientModified, dontUpdatePreviews }: {
|
||||||
|
bypassDebouncer: any;
|
||||||
|
updateClientModified: any;
|
||||||
|
dontUpdatePreviews: any;
|
||||||
|
}): void;
|
||||||
|
saveTimeout: any;
|
||||||
|
showSavingStatus(): void;
|
||||||
|
showAllChangesSavedStatus(): void;
|
||||||
|
showErrorStatus(error: any): void;
|
||||||
|
setStatus(status: any, wait?: boolean): void;
|
||||||
|
statusTimeout: any;
|
||||||
|
contentChanged(): void;
|
||||||
|
onTitleEnter($event: any): void;
|
||||||
|
onTitleChange(): void;
|
||||||
|
focusEditor(): void;
|
||||||
|
lastEditorFocusEventSource: number | null | undefined;
|
||||||
|
focusTitle(): void;
|
||||||
|
clickedTextArea(): void;
|
||||||
|
onNameFocus(): void;
|
||||||
|
editingName: boolean | undefined;
|
||||||
|
onContentFocus(): void;
|
||||||
|
onNameBlur(): void;
|
||||||
|
selectedMenuItem(hide: any): void;
|
||||||
|
deleteNote(permanently: any): Promise<void>;
|
||||||
|
performNoteDeletion(note: any): void;
|
||||||
|
restoreTrashedNote(): void;
|
||||||
|
deleteNotePermanantely(): void;
|
||||||
|
getTrashCount(): any;
|
||||||
|
emptyTrash(): void;
|
||||||
|
togglePin(): void;
|
||||||
|
toggleLockNote(): void;
|
||||||
|
toggleProtectNote(): void;
|
||||||
|
toggleNotePreview(): void;
|
||||||
|
toggleArchiveNote(): void;
|
||||||
|
reloadTagsString(): void;
|
||||||
|
addTag(tag: any): void;
|
||||||
|
removeTag(tag: any): void;
|
||||||
|
saveTags({ strings }?: {
|
||||||
|
strings: any;
|
||||||
|
}): Promise<void>;
|
||||||
|
onPanelResizeFinish: (width: any, left: any, isMaxWidth: any) => void;
|
||||||
|
reloadPreferences(): void;
|
||||||
|
reloadFont(): void;
|
||||||
|
toggleKey(key: any): Promise<void>;
|
||||||
|
registerComponentHandler(): void;
|
||||||
|
reloadComponentStackArray(): void;
|
||||||
|
reloadComponentContext(): void;
|
||||||
|
toggleStackComponentForCurrentItem(component: any): void;
|
||||||
|
disassociateComponentWithCurrentNote(component: any): void;
|
||||||
|
associateComponentWithCurrentNote(component: any): void;
|
||||||
|
registerKeyboardShortcuts(): void;
|
||||||
|
altKeyObserver: any;
|
||||||
|
trashKeyObserver: any;
|
||||||
|
deleteKeyObserver: any;
|
||||||
|
onSystemEditorLoad(): void;
|
||||||
|
tabObserver: any;
|
||||||
|
removeTabObserver(): void;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
69
app/assets/javascripts/@types/app/assets/javascripts/controllers/footer.d.ts
vendored
Normal file
69
app/assets/javascripts/@types/app/assets/javascripts/controllers/footer.d.ts
vendored
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
export class Footer {
|
||||||
|
restrict: string;
|
||||||
|
template: any;
|
||||||
|
controller: typeof FooterCtrl;
|
||||||
|
replace: boolean;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: {
|
||||||
|
application: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
declare class FooterCtrl {
|
||||||
|
constructor($rootScope: any, $timeout: any);
|
||||||
|
$rootScope: any;
|
||||||
|
rooms: any[];
|
||||||
|
themesWithIcons: any[];
|
||||||
|
showSyncResolution: any;
|
||||||
|
deinit(): void;
|
||||||
|
unregisterComponent: any;
|
||||||
|
rootScopeListener1: any;
|
||||||
|
rootScopeListener2: any;
|
||||||
|
closeAccountMenu: () => void;
|
||||||
|
toggleSyncResolutionMenu: () => void;
|
||||||
|
$onInit(): void;
|
||||||
|
arbitraryStatusMessage: any;
|
||||||
|
getInitialState(): {
|
||||||
|
hasPasscode: boolean;
|
||||||
|
};
|
||||||
|
reloadUpgradeStatus(): void;
|
||||||
|
onAppLaunch(): void;
|
||||||
|
user: any;
|
||||||
|
reloadPasscodeStatus(): Promise<void>;
|
||||||
|
addRootScopeListeners(): void;
|
||||||
|
/** @override */
|
||||||
|
onAppStateEvent(eventName: any, data: any): void;
|
||||||
|
backupStatus: any;
|
||||||
|
/** @override */
|
||||||
|
onAppKeyChange(): Promise<void>;
|
||||||
|
/** @override */
|
||||||
|
onAppEvent(eventName: any): void;
|
||||||
|
showAccountMenu: any;
|
||||||
|
streamItems(): void;
|
||||||
|
queueExtReload: boolean | undefined;
|
||||||
|
registerComponentHandler(): void;
|
||||||
|
reloadExtendedData(): void;
|
||||||
|
reloadInProgress: boolean | undefined;
|
||||||
|
updateOfflineStatus(): void;
|
||||||
|
offline: any;
|
||||||
|
openSecurityUpdate(): void;
|
||||||
|
findErrors(): void;
|
||||||
|
error: any;
|
||||||
|
accountMenuPressed(): void;
|
||||||
|
lockApp(): void;
|
||||||
|
refreshData(): void;
|
||||||
|
isRefreshing: boolean | undefined;
|
||||||
|
syncUpdated(): void;
|
||||||
|
lastSyncDate: any;
|
||||||
|
onNewUpdateAvailable(): void;
|
||||||
|
newUpdateAvailable: boolean | undefined;
|
||||||
|
clickedNewUpdateAnnouncement(): void;
|
||||||
|
reloadDockShortcuts(): void;
|
||||||
|
dockShortcuts: any;
|
||||||
|
initSvgForShortcut(shortcut: any): void;
|
||||||
|
selectShortcut(shortcut: any): void;
|
||||||
|
onRoomDismiss(room: any): void;
|
||||||
|
closeAllRooms(): void;
|
||||||
|
selectRoom(room: any): Promise<void>;
|
||||||
|
clickOutsideAccountMenu(): void;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
7
app/assets/javascripts/@types/app/assets/javascripts/controllers/index.d.ts
vendored
Normal file
7
app/assets/javascripts/@types/app/assets/javascripts/controllers/index.d.ts
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export { PureCtrl } from "./abstract/pure_ctrl";
|
||||||
|
export { EditorPanel } from "./editor";
|
||||||
|
export { Footer } from "./footer";
|
||||||
|
export { NotesPanel } from "./notes/notes";
|
||||||
|
export { TagsPanel } from "./tags";
|
||||||
|
export { Root } from "./root";
|
||||||
|
export { ApplicationView } from "./applicationView";
|
||||||
23
app/assets/javascripts/@types/app/assets/javascripts/controllers/lockScreen.depr.d.ts
vendored
Normal file
23
app/assets/javascripts/@types/app/assets/javascripts/controllers/lockScreen.depr.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
export class LockScreen {
|
||||||
|
restrict: string;
|
||||||
|
template: any;
|
||||||
|
controller: typeof LockScreenCtrl;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: boolean;
|
||||||
|
scope: {
|
||||||
|
onValue: string;
|
||||||
|
puppet: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
declare class LockScreenCtrl extends PureCtrl {
|
||||||
|
constructor($timeout: any);
|
||||||
|
formData: {};
|
||||||
|
get passcodeInput(): HTMLElement | null;
|
||||||
|
/** @override */
|
||||||
|
onAppStateEvent(eventName: any, data: any): Promise<void>;
|
||||||
|
submitPasscodeForm(): Promise<void>;
|
||||||
|
forgotPasscode(): void;
|
||||||
|
beginDeleteData(): void;
|
||||||
|
}
|
||||||
|
import { PureCtrl } from "./abstract/pure_ctrl";
|
||||||
|
export {};
|
||||||
25
app/assets/javascripts/@types/app/assets/javascripts/controllers/notes/note_utils.d.ts
vendored
Normal file
25
app/assets/javascripts/@types/app/assets/javascripts/controllers/notes/note_utils.d.ts
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
export function filterAndSortNotes({ notes, selectedTag, showArchived, hidePinned, filterText, sortBy, reverse }: {
|
||||||
|
notes: any;
|
||||||
|
selectedTag: any;
|
||||||
|
showArchived: any;
|
||||||
|
hidePinned: any;
|
||||||
|
filterText: any;
|
||||||
|
sortBy: any;
|
||||||
|
reverse: any;
|
||||||
|
}): any[];
|
||||||
|
export function filterNotes({ notes, selectedTag, showArchived, hidePinned, filterText }: {
|
||||||
|
notes: any;
|
||||||
|
selectedTag: any;
|
||||||
|
showArchived: any;
|
||||||
|
hidePinned: any;
|
||||||
|
filterText: any;
|
||||||
|
}): any;
|
||||||
|
export function sortNotes({ notes, sortBy, reverse }: {
|
||||||
|
notes?: any[] | undefined;
|
||||||
|
sortBy: any;
|
||||||
|
reverse: any;
|
||||||
|
}): any[];
|
||||||
|
export const SORT_KEY_CREATED_AT: "created_at";
|
||||||
|
export const SORT_KEY_UPDATED_AT: "updated_at";
|
||||||
|
export const SORT_KEY_CLIENT_UPDATED_AT: "client_updated_at";
|
||||||
|
export const SORT_KEY_TITLE: "title";
|
||||||
118
app/assets/javascripts/@types/app/assets/javascripts/controllers/notes/notes.d.ts
vendored
Normal file
118
app/assets/javascripts/@types/app/assets/javascripts/controllers/notes/notes.d.ts
vendored
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
export class NotesPanel {
|
||||||
|
template: any;
|
||||||
|
replace: boolean;
|
||||||
|
controller: typeof NotesCtrl;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: boolean;
|
||||||
|
scope: {
|
||||||
|
application: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
declare class NotesCtrl {
|
||||||
|
constructor($timeout: any);
|
||||||
|
$onInit(): void;
|
||||||
|
panelPuppet: {
|
||||||
|
onReady: () => void;
|
||||||
|
} | null | undefined;
|
||||||
|
onWindowResize(): void;
|
||||||
|
deinit(): void;
|
||||||
|
onPanelResize: (newWidth: any, lastLeft: any, isAtMaxWidth: any, isCollapsed: any) => void;
|
||||||
|
getInitialState(): {
|
||||||
|
notes: never[];
|
||||||
|
renderedNotes: never[];
|
||||||
|
selectedNote: null;
|
||||||
|
tag: null;
|
||||||
|
sortBy: null;
|
||||||
|
showArchived: null;
|
||||||
|
hidePinned: null;
|
||||||
|
sortReverse: null;
|
||||||
|
panelTitle: null;
|
||||||
|
mutable: {
|
||||||
|
showMenu: boolean;
|
||||||
|
};
|
||||||
|
noteFilter: {
|
||||||
|
text: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
onAppLaunch(): void;
|
||||||
|
/** @override */
|
||||||
|
onAppStateEvent(eventName: any, data: any): void;
|
||||||
|
/** @override */
|
||||||
|
onAppEvent(eventName: any): Promise<void>;
|
||||||
|
/**
|
||||||
|
* @access private
|
||||||
|
* Access the current state notes without awaiting any potential reloads
|
||||||
|
* that may be in progress. This is the sync alternative to `async getMostValidNotes`
|
||||||
|
*/
|
||||||
|
getPossiblyStaleNotes(): any;
|
||||||
|
/**
|
||||||
|
* @access private
|
||||||
|
* Access the current state notes after waiting for any pending reloads.
|
||||||
|
* This returns the most up to date notes, but is the asyncronous counterpart
|
||||||
|
* to `getPossiblyStaleNotes`
|
||||||
|
*/
|
||||||
|
getMostValidNotes(): Promise<any>;
|
||||||
|
/**
|
||||||
|
* Triggered programatically to create a new placeholder note
|
||||||
|
* when conditions allow for it. This is as opposed to creating a new note
|
||||||
|
* as part of user interaction (pressing the + button).
|
||||||
|
* @access private
|
||||||
|
*/
|
||||||
|
createPlaceholderNote(): Promise<void>;
|
||||||
|
streamNotesAndTags(): void;
|
||||||
|
selectNote(note: any): Promise<any>;
|
||||||
|
createNewNote(): Promise<void>;
|
||||||
|
handleTagChange(tag: any, previousTag: any): Promise<void>;
|
||||||
|
resetScrollPosition(): void;
|
||||||
|
removeNoteFromList(note: any): Promise<void>;
|
||||||
|
reloadNotes(): Promise<void>;
|
||||||
|
reloadNotesPromise: Promise<void> | undefined;
|
||||||
|
performPeloadNotes(): Promise<void>;
|
||||||
|
setShowMenuFalse(): void;
|
||||||
|
handleNoteSelection(note: any): Promise<void>;
|
||||||
|
selectedIndex: number | undefined;
|
||||||
|
reloadPreferences(): void;
|
||||||
|
paginate(): void;
|
||||||
|
resetPagination({ keepCurrentIfLarger }?: {
|
||||||
|
keepCurrentIfLarger: any;
|
||||||
|
}): void;
|
||||||
|
pageSize: number | undefined;
|
||||||
|
notesToDisplay: number | undefined;
|
||||||
|
reloadPanelTitle(): void;
|
||||||
|
optionsSubtitle(): string;
|
||||||
|
loadFlagsForNote(note: any): {
|
||||||
|
text: string;
|
||||||
|
class: string;
|
||||||
|
}[];
|
||||||
|
displayableNotes(): any;
|
||||||
|
getFirstNonProtectedNote(): any;
|
||||||
|
selectFirstNote(): void;
|
||||||
|
selectNextNote(): void;
|
||||||
|
selectNextOrCreateNew(): void;
|
||||||
|
selectPreviousNote(): boolean;
|
||||||
|
isFiltering(): boolean;
|
||||||
|
setNoteFilterText(text: any): Promise<void>;
|
||||||
|
clearFilterText(): Promise<void>;
|
||||||
|
filterTextChanged(): Promise<void>;
|
||||||
|
searchSubmitted: boolean | undefined;
|
||||||
|
onFilterEnter(): void;
|
||||||
|
selectedMenuItem(): void;
|
||||||
|
togglePrefKey(key: any): void;
|
||||||
|
selectedSortByCreated(): void;
|
||||||
|
selectedSortByUpdated(): void;
|
||||||
|
selectedSortByTitle(): void;
|
||||||
|
toggleReverseSort(): void;
|
||||||
|
setSortBy(type: any): void;
|
||||||
|
shouldShowTagsForNote(note: any): boolean;
|
||||||
|
getSearchBar(): HTMLElement | null;
|
||||||
|
registerKeyboardShortcuts(): void;
|
||||||
|
/**
|
||||||
|
* In the browser we're not allowed to override cmd/ctrl + n, so we have to
|
||||||
|
* use Control modifier as well. These rules don't apply to desktop, but
|
||||||
|
* probably better to be consistent.
|
||||||
|
*/
|
||||||
|
newNoteKeyObserver: any;
|
||||||
|
nextNoteKeyObserver: any;
|
||||||
|
searchKeyObserver: any;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
15
app/assets/javascripts/@types/app/assets/javascripts/controllers/root.d.ts
vendored
Normal file
15
app/assets/javascripts/@types/app/assets/javascripts/controllers/root.d.ts
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
export class Root {
|
||||||
|
template: any;
|
||||||
|
controller: typeof RootCtrl;
|
||||||
|
replace: boolean;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: boolean;
|
||||||
|
}
|
||||||
|
declare class RootCtrl {
|
||||||
|
constructor($timeout: any, applicationManager: any);
|
||||||
|
$timeout: any;
|
||||||
|
applicationManager: any;
|
||||||
|
reload(): void;
|
||||||
|
applications: any;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
52
app/assets/javascripts/@types/app/assets/javascripts/controllers/tags.d.ts
vendored
Normal file
52
app/assets/javascripts/@types/app/assets/javascripts/controllers/tags.d.ts
vendored
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
export class TagsPanel {
|
||||||
|
restrict: string;
|
||||||
|
scope: {
|
||||||
|
application: string;
|
||||||
|
};
|
||||||
|
template: any;
|
||||||
|
replace: boolean;
|
||||||
|
controller: typeof TagsPanelCtrl;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: boolean;
|
||||||
|
}
|
||||||
|
declare class TagsPanelCtrl {
|
||||||
|
constructor($timeout: any);
|
||||||
|
panelPuppet: {
|
||||||
|
onReady: () => void;
|
||||||
|
};
|
||||||
|
deinit(): void;
|
||||||
|
unregisterComponent: any;
|
||||||
|
getInitialState(): {
|
||||||
|
tags: never[];
|
||||||
|
smartTags: never[];
|
||||||
|
noteCounts: {};
|
||||||
|
};
|
||||||
|
onAppStart(): void;
|
||||||
|
onAppLaunch(): void;
|
||||||
|
/** @override */
|
||||||
|
onAppSync(): void;
|
||||||
|
/**
|
||||||
|
* Returns all officially saved tags as reported by the model manager.
|
||||||
|
* @access private
|
||||||
|
*/
|
||||||
|
getMappedTags(): any;
|
||||||
|
beginStreamingItems(): void;
|
||||||
|
/** @override */
|
||||||
|
onAppStateEvent(eventName: any, data: any): void;
|
||||||
|
/** @override */
|
||||||
|
onAppEvent(eventName: any): Promise<void>;
|
||||||
|
reloadNoteCounts(): void;
|
||||||
|
loadPreferences(): void;
|
||||||
|
onPanelResize: (newWidth: any, lastLeft: any, isAtMaxWidth: any, isCollapsed: any) => void;
|
||||||
|
registerComponentHandler(): void;
|
||||||
|
component: any;
|
||||||
|
selectTag(tag: any): Promise<void>;
|
||||||
|
clickedAddNewTag(): Promise<void>;
|
||||||
|
tagTitleDidChange(tag: any): void;
|
||||||
|
saveTag($event: any, tag: any): Promise<void>;
|
||||||
|
editingOriginalName: any;
|
||||||
|
selectedRenameTag($event: any, tag: any): Promise<void>;
|
||||||
|
selectedDeleteTag(tag: any): void;
|
||||||
|
removeTag(tag: any): void;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
43
app/assets/javascripts/@types/app/assets/javascripts/database.d.ts
vendored
Normal file
43
app/assets/javascripts/@types/app/assets/javascripts/database.d.ts
vendored
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
export class Database {
|
||||||
|
locked: boolean;
|
||||||
|
/** @access public */
|
||||||
|
deinit(): void;
|
||||||
|
alertService: any;
|
||||||
|
db: any;
|
||||||
|
/** @access public */
|
||||||
|
setApplication(application: any): void;
|
||||||
|
/**
|
||||||
|
* Relinquishes the lock and allows db operations to proceed
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
unlock(): void;
|
||||||
|
/**
|
||||||
|
* Opens the database natively, or returns the existing database object if already opened.
|
||||||
|
* @access public
|
||||||
|
* @param {function} onNewDatabase - Callback to invoke when a database has been created
|
||||||
|
* as part of the open process. This can happen on new application sessions, or if the
|
||||||
|
* browser deleted the database without the user being aware.
|
||||||
|
*/
|
||||||
|
openDatabase(onNewDatabase: Function): Promise<any>;
|
||||||
|
/** @access public */
|
||||||
|
getAllPayloads(): Promise<any>;
|
||||||
|
/** @access public */
|
||||||
|
savePayload(payload: any): Promise<any>;
|
||||||
|
/** @access public */
|
||||||
|
savePayloads(payloads: any): Promise<any>;
|
||||||
|
/** @access private */
|
||||||
|
putItems(objectStore: any, items: any): Promise<[any, any, any, any, any, any, any, any, any, any]>;
|
||||||
|
/** @access public */
|
||||||
|
deletePayload(uuid: any): Promise<any>;
|
||||||
|
/** @access public */
|
||||||
|
clearAllPayloads(): Promise<any>;
|
||||||
|
/** @access private */
|
||||||
|
showAlert(message: any): void;
|
||||||
|
/**
|
||||||
|
* @access private
|
||||||
|
* @param {object} error - {code, name}
|
||||||
|
*/
|
||||||
|
showGenericError(error: object): void;
|
||||||
|
/** @access private */
|
||||||
|
displayOfflineAlert(): void;
|
||||||
|
}
|
||||||
7
app/assets/javascripts/@types/app/assets/javascripts/directives/functional/autofocus.d.ts
vendored
Normal file
7
app/assets/javascripts/@types/app/assets/javascripts/directives/functional/autofocus.d.ts
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export function autofocus($timeout: any): {
|
||||||
|
restrict: string;
|
||||||
|
scope: {
|
||||||
|
shouldFocus: string;
|
||||||
|
};
|
||||||
|
link: ($scope: any, $element: any) => void;
|
||||||
|
};
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
export function clickOutside($document: any): {
|
||||||
|
restrict: string;
|
||||||
|
replace: boolean;
|
||||||
|
link: ($scope: any, $element: any, attrs: any) => void;
|
||||||
|
};
|
||||||
8
app/assets/javascripts/@types/app/assets/javascripts/directives/functional/delay-hide.d.ts
vendored
Normal file
8
app/assets/javascripts/@types/app/assets/javascripts/directives/functional/delay-hide.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export function delayHide($timeout: any): {
|
||||||
|
restrict: string;
|
||||||
|
scope: {
|
||||||
|
show: string;
|
||||||
|
delay: string;
|
||||||
|
};
|
||||||
|
link: (scope: any, elem: any, attrs: any) => void;
|
||||||
|
};
|
||||||
4
app/assets/javascripts/@types/app/assets/javascripts/directives/functional/elemReady.d.ts
vendored
Normal file
4
app/assets/javascripts/@types/app/assets/javascripts/directives/functional/elemReady.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export function elemReady($parse: any): {
|
||||||
|
restrict: string;
|
||||||
|
link: ($scope: any, elem: any, attrs: any) => void;
|
||||||
|
};
|
||||||
7
app/assets/javascripts/@types/app/assets/javascripts/directives/functional/file-change.d.ts
vendored
Normal file
7
app/assets/javascripts/@types/app/assets/javascripts/directives/functional/file-change.d.ts
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export function fileChange(): {
|
||||||
|
restrict: string;
|
||||||
|
scope: {
|
||||||
|
handler: string;
|
||||||
|
};
|
||||||
|
link: (scope: any, element: any) => void;
|
||||||
|
};
|
||||||
9
app/assets/javascripts/@types/app/assets/javascripts/directives/functional/index.d.ts
vendored
Normal file
9
app/assets/javascripts/@types/app/assets/javascripts/directives/functional/index.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
export { autofocus } from "./autofocus";
|
||||||
|
export { clickOutside } from "./click-outside";
|
||||||
|
export { delayHide } from "./delay-hide";
|
||||||
|
export { elemReady } from "./elemReady";
|
||||||
|
export { fileChange } from "./file-change";
|
||||||
|
export { infiniteScroll } from "./infiniteScroll";
|
||||||
|
export { lowercase } from "./lowercase";
|
||||||
|
export { selectOnClick } from "./selectOnClick";
|
||||||
|
export { snEnter } from "./snEnter";
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export function infiniteScroll(): {
|
||||||
|
link: (scope: any, elem: any, attrs: any) => void;
|
||||||
|
};
|
||||||
4
app/assets/javascripts/@types/app/assets/javascripts/directives/functional/lowercase.d.ts
vendored
Normal file
4
app/assets/javascripts/@types/app/assets/javascripts/directives/functional/lowercase.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export function lowercase(): {
|
||||||
|
require: string;
|
||||||
|
link: (scope: any, element: any, attrs: any, modelCtrl: any) => void;
|
||||||
|
};
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
export function selectOnClick($window: any): {
|
||||||
|
restrict: string;
|
||||||
|
link: (scope: any, element: any, attrs: any) => void;
|
||||||
|
};
|
||||||
1
app/assets/javascripts/@types/app/assets/javascripts/directives/functional/snEnter.d.ts
vendored
Normal file
1
app/assets/javascripts/@types/app/assets/javascripts/directives/functional/snEnter.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export function snEnter(): (scope: any, element: any, attrs: any) => void;
|
||||||
71
app/assets/javascripts/@types/app/assets/javascripts/directives/views/accountMenu.d.ts
vendored
Normal file
71
app/assets/javascripts/@types/app/assets/javascripts/directives/views/accountMenu.d.ts
vendored
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
export class AccountMenu {
|
||||||
|
restrict: string;
|
||||||
|
template: any;
|
||||||
|
controller: typeof AccountMenuCtrl;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: boolean;
|
||||||
|
scope: {
|
||||||
|
closeFunction: string;
|
||||||
|
application: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
declare class AccountMenuCtrl {
|
||||||
|
constructor($timeout: any, appVersion: any);
|
||||||
|
appVersion: any;
|
||||||
|
/** @override */
|
||||||
|
getInitialState(): {
|
||||||
|
appVersion: string;
|
||||||
|
passcodeAutoLockOptions: any;
|
||||||
|
user: any;
|
||||||
|
formData: {
|
||||||
|
mergeLocal: boolean;
|
||||||
|
ephemeral: boolean;
|
||||||
|
};
|
||||||
|
mutable: {};
|
||||||
|
};
|
||||||
|
onAppKeyChange(): Promise<void>;
|
||||||
|
onAppLaunch(): Promise<void>;
|
||||||
|
refreshedCredentialState(): {
|
||||||
|
user: any;
|
||||||
|
canAddPasscode: boolean;
|
||||||
|
hasPasscode: any;
|
||||||
|
showPasscodeForm: boolean;
|
||||||
|
};
|
||||||
|
$onInit(): void;
|
||||||
|
syncStatus: any;
|
||||||
|
close(): void;
|
||||||
|
loadHost(): Promise<void>;
|
||||||
|
onHostInputChange(): void;
|
||||||
|
loadBackupsAvailability(): Promise<void>;
|
||||||
|
submitMfaForm(): void;
|
||||||
|
blurAuthFields(): void;
|
||||||
|
submitAuthForm(): void;
|
||||||
|
setFormDataState(formData: any): Promise<any>;
|
||||||
|
login(): Promise<void>;
|
||||||
|
register(): Promise<void>;
|
||||||
|
mergeLocalChanged(): void;
|
||||||
|
openPasswordWizard(): void;
|
||||||
|
openPrivilegesModal(): Promise<void>;
|
||||||
|
destroyLocalData(): void;
|
||||||
|
submitImportPassword(): Promise<void>;
|
||||||
|
readFile(file: any): Promise<any>;
|
||||||
|
/**
|
||||||
|
* @template
|
||||||
|
*/
|
||||||
|
importFileSelected<(Missing)>(files: any): Promise<void>;
|
||||||
|
performImport(data: any, password: any): Promise<void>;
|
||||||
|
importJSONData(data: any, password: any): Promise<any>;
|
||||||
|
downloadDataArchive(): Promise<void>;
|
||||||
|
notesAndTagsCount(): any;
|
||||||
|
encryptionStatusForNotes(): string;
|
||||||
|
reloadAutoLockInterval(): Promise<void>;
|
||||||
|
selectAutoLockInterval(interval: any): Promise<void>;
|
||||||
|
hidePasswordForm(): void;
|
||||||
|
hasPasscode(): any;
|
||||||
|
addPasscodeClicked(): void;
|
||||||
|
submitPasscodeForm(): void;
|
||||||
|
changePasscodePressed(): Promise<void>;
|
||||||
|
removePasscodePressed(): Promise<void>;
|
||||||
|
isDesktopApplication(): any;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
24
app/assets/javascripts/@types/app/assets/javascripts/directives/views/actionsMenu.d.ts
vendored
Normal file
24
app/assets/javascripts/@types/app/assets/javascripts/directives/views/actionsMenu.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
export class ActionsMenu {
|
||||||
|
restrict: string;
|
||||||
|
template: any;
|
||||||
|
replace: boolean;
|
||||||
|
controller: typeof ActionsMenuCtrl;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: boolean;
|
||||||
|
scope: {
|
||||||
|
item: string;
|
||||||
|
application: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
declare class ActionsMenuCtrl {
|
||||||
|
constructor($timeout: any);
|
||||||
|
state: {
|
||||||
|
extensions: never[];
|
||||||
|
};
|
||||||
|
$onInit(): void;
|
||||||
|
loadExtensions(): Promise<void>;
|
||||||
|
executeAction(action: any, extension: any): Promise<void>;
|
||||||
|
handleActionResult(action: any, result: any): void;
|
||||||
|
subRowsForAction(parentAction: any, extension: any): any;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
29
app/assets/javascripts/@types/app/assets/javascripts/directives/views/challengeModal.d.ts
vendored
Normal file
29
app/assets/javascripts/@types/app/assets/javascripts/directives/views/challengeModal.d.ts
vendored
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
export class ChallengeModal {
|
||||||
|
restrict: string;
|
||||||
|
template: any;
|
||||||
|
controller: typeof ChallengeModalCtrl;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: {
|
||||||
|
challenge: string;
|
||||||
|
orchestrator: string;
|
||||||
|
application: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
declare class ChallengeModalCtrl {
|
||||||
|
constructor($element: any, $timeout: any);
|
||||||
|
$element: any;
|
||||||
|
processingTypes: any[];
|
||||||
|
$onInit(): void;
|
||||||
|
deinit(): void;
|
||||||
|
application: any;
|
||||||
|
orchestrator: any;
|
||||||
|
challenge: any;
|
||||||
|
reloadProcessingStatus(): void;
|
||||||
|
promptForChallenge(challenge: any): "Enter your application passcode" | "Enter your account password";
|
||||||
|
cancel(): void;
|
||||||
|
onTextValueChange(challenge: any): void;
|
||||||
|
validate(): boolean;
|
||||||
|
submit(): Promise<void>;
|
||||||
|
dismiss(): void;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
19
app/assets/javascripts/@types/app/assets/javascripts/directives/views/componentModal.d.ts
vendored
Normal file
19
app/assets/javascripts/@types/app/assets/javascripts/directives/views/componentModal.d.ts
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
export class ComponentModalCtrl {
|
||||||
|
constructor($element: any);
|
||||||
|
$element: any;
|
||||||
|
dismiss(): void;
|
||||||
|
}
|
||||||
|
export class ComponentModal {
|
||||||
|
restrict: string;
|
||||||
|
template: any;
|
||||||
|
controller: typeof ComponentModalCtrl;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: boolean;
|
||||||
|
scope: {
|
||||||
|
show: string;
|
||||||
|
component: string;
|
||||||
|
callback: string;
|
||||||
|
onDismiss: string;
|
||||||
|
application: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
47
app/assets/javascripts/@types/app/assets/javascripts/directives/views/componentView.d.ts
vendored
Normal file
47
app/assets/javascripts/@types/app/assets/javascripts/directives/views/componentView.d.ts
vendored
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
export class ComponentView {
|
||||||
|
restrict: string;
|
||||||
|
template: any;
|
||||||
|
scope: {
|
||||||
|
component: string;
|
||||||
|
onLoad: string;
|
||||||
|
manualDealloc: string;
|
||||||
|
application: string;
|
||||||
|
};
|
||||||
|
controller: typeof ComponentViewCtrl;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: boolean;
|
||||||
|
}
|
||||||
|
declare class ComponentViewCtrl {
|
||||||
|
constructor($scope: any, $rootScope: any, $timeout: any);
|
||||||
|
$rootScope: any;
|
||||||
|
$timeout: any;
|
||||||
|
componentValid: boolean;
|
||||||
|
cleanUpOn: any;
|
||||||
|
onVisibilityChange(): void;
|
||||||
|
$onDestroy(): void;
|
||||||
|
unregisterComponentHandler: any;
|
||||||
|
unregisterDesktopObserver: any;
|
||||||
|
component: any;
|
||||||
|
onLoad: any;
|
||||||
|
application: any;
|
||||||
|
$onChanges(): void;
|
||||||
|
didRegisterObservers: boolean | undefined;
|
||||||
|
lastComponentValue: any;
|
||||||
|
registerPackageUpdateObserver(): void;
|
||||||
|
registerComponentHandlers(): void;
|
||||||
|
reloadComponent(): Promise<void>;
|
||||||
|
reloadStatus(doManualReload?: boolean): void;
|
||||||
|
reloading: boolean | undefined;
|
||||||
|
expired: boolean | undefined;
|
||||||
|
loading: boolean | undefined;
|
||||||
|
error: string | null | undefined;
|
||||||
|
handleActivation(): void;
|
||||||
|
loadTimeout: any;
|
||||||
|
handleIframeLoadTimeout(): Promise<void>;
|
||||||
|
issueLoading: boolean | undefined;
|
||||||
|
didAttemptReload: boolean | undefined;
|
||||||
|
handleIframeLoad(iframe: any): Promise<void>;
|
||||||
|
disableActiveTheme(): void;
|
||||||
|
getUrl(): any;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
export class ConflictResolutionModal {
|
||||||
|
restrict: string;
|
||||||
|
template: any;
|
||||||
|
controller: typeof ConflictResolutionCtrl;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: boolean;
|
||||||
|
scope: {
|
||||||
|
item1: string;
|
||||||
|
item2: string;
|
||||||
|
callback: string;
|
||||||
|
application: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
declare class ConflictResolutionCtrl {
|
||||||
|
constructor($element: any);
|
||||||
|
$element: any;
|
||||||
|
$onInit(): void;
|
||||||
|
contentType: any;
|
||||||
|
item1Content: string | undefined;
|
||||||
|
item2Content: string | undefined;
|
||||||
|
createContentString(item: any): string;
|
||||||
|
keepItem1(): void;
|
||||||
|
keepItem2(): void;
|
||||||
|
keepBoth(): void;
|
||||||
|
export(): void;
|
||||||
|
triggerCallback(): void;
|
||||||
|
dismiss(): void;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
27
app/assets/javascripts/@types/app/assets/javascripts/directives/views/editorMenu.d.ts
vendored
Normal file
27
app/assets/javascripts/@types/app/assets/javascripts/directives/views/editorMenu.d.ts
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
export class EditorMenu {
|
||||||
|
restrict: string;
|
||||||
|
template: any;
|
||||||
|
controller: typeof EditorMenuCtrl;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: boolean;
|
||||||
|
scope: {
|
||||||
|
callback: string;
|
||||||
|
selectedEditor: string;
|
||||||
|
currentItem: string;
|
||||||
|
application: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
declare class EditorMenuCtrl {
|
||||||
|
constructor($timeout: any);
|
||||||
|
state: {
|
||||||
|
isDesktop: any;
|
||||||
|
};
|
||||||
|
$onInit(): void;
|
||||||
|
selectComponent(component: any): void;
|
||||||
|
toggleDefaultForEditor(editor: any): void;
|
||||||
|
offlineAvailableForComponent(component: any): any;
|
||||||
|
makeEditorDefault(component: any): void;
|
||||||
|
removeEditorDefault(component: any): void;
|
||||||
|
shouldDisplayRunningLocallyLabel(component: any): boolean;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
17
app/assets/javascripts/@types/app/assets/javascripts/directives/views/index.d.ts
vendored
Normal file
17
app/assets/javascripts/@types/app/assets/javascripts/directives/views/index.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
export { AccountMenu } from "./accountMenu";
|
||||||
|
export { ActionsMenu } from "./actionsMenu";
|
||||||
|
export { ChallengeModal } from "./challengeModal";
|
||||||
|
export { ComponentModal } from "./componentModal";
|
||||||
|
export { ComponentView } from "./componentView";
|
||||||
|
export { ConflictResolutionModal } from "./conflictResolutionModal";
|
||||||
|
export { EditorMenu } from "./editorMenu";
|
||||||
|
export { InputModal } from "./inputModal";
|
||||||
|
export { MenuRow } from "./menuRow";
|
||||||
|
export { PanelResizer } from "./panelResizer";
|
||||||
|
export { PasswordWizard } from "./passwordWizard";
|
||||||
|
export { PermissionsModal } from "./permissionsModal";
|
||||||
|
export { PrivilegesAuthModal } from "./privilegesAuthModal";
|
||||||
|
export { PrivilegesManagementModal } from "./privilegesManagementModal";
|
||||||
|
export { RevisionPreviewModal } from "./revisionPreviewModal";
|
||||||
|
export { SessionHistoryMenu } from "./sessionHistoryMenu";
|
||||||
|
export { SyncResolutionMenu } from "./syncResolutionMenu";
|
||||||
22
app/assets/javascripts/@types/app/assets/javascripts/directives/views/inputModal.d.ts
vendored
Normal file
22
app/assets/javascripts/@types/app/assets/javascripts/directives/views/inputModal.d.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
export class InputModal {
|
||||||
|
restrict: string;
|
||||||
|
template: any;
|
||||||
|
controller: typeof InputModalCtrl;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: boolean;
|
||||||
|
scope: {
|
||||||
|
type: string;
|
||||||
|
title: string;
|
||||||
|
message: string;
|
||||||
|
placeholder: string;
|
||||||
|
callback: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
declare class InputModalCtrl {
|
||||||
|
constructor($element: any);
|
||||||
|
$element: any;
|
||||||
|
formData: {};
|
||||||
|
dismiss(): void;
|
||||||
|
submit(): void;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
30
app/assets/javascripts/@types/app/assets/javascripts/directives/views/menuRow.d.ts
vendored
Normal file
30
app/assets/javascripts/@types/app/assets/javascripts/directives/views/menuRow.d.ts
vendored
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
export class MenuRow {
|
||||||
|
restrict: string;
|
||||||
|
transclude: boolean;
|
||||||
|
template: any;
|
||||||
|
controller: typeof MenuRowCtrl;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: boolean;
|
||||||
|
scope: {
|
||||||
|
action: string;
|
||||||
|
buttonAction: string;
|
||||||
|
buttonClass: string;
|
||||||
|
buttonText: string;
|
||||||
|
desc: string;
|
||||||
|
disabled: string;
|
||||||
|
circle: string;
|
||||||
|
circleAlign: string;
|
||||||
|
faded: string;
|
||||||
|
hasButton: string;
|
||||||
|
label: string;
|
||||||
|
spinnerClass: string;
|
||||||
|
stylekitClass: string;
|
||||||
|
subRows: string;
|
||||||
|
subtitle: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
declare class MenuRowCtrl {
|
||||||
|
onClick($event: any): void;
|
||||||
|
clickAccessoryButton($event: any): void;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
72
app/assets/javascripts/@types/app/assets/javascripts/directives/views/panelResizer.d.ts
vendored
Normal file
72
app/assets/javascripts/@types/app/assets/javascripts/directives/views/panelResizer.d.ts
vendored
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
export class PanelResizer {
|
||||||
|
restrict: string;
|
||||||
|
template: any;
|
||||||
|
controller: typeof PanelResizerCtrl;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: boolean;
|
||||||
|
scope: {
|
||||||
|
alwaysVisible: string;
|
||||||
|
collapsable: string;
|
||||||
|
control: string;
|
||||||
|
defaultWidth: string;
|
||||||
|
hoverable: string;
|
||||||
|
index: string;
|
||||||
|
minWidth: string;
|
||||||
|
onResizeFinish: string;
|
||||||
|
panelId: string;
|
||||||
|
property: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
declare class PanelResizerCtrl {
|
||||||
|
constructor($compile: any, $element: any, $timeout: any);
|
||||||
|
$compile: any;
|
||||||
|
$element: any;
|
||||||
|
$timeout: any;
|
||||||
|
handleResize(): void;
|
||||||
|
onMouseMove(event: any): void;
|
||||||
|
onMouseUp(): void;
|
||||||
|
onMouseDown(event: any): void;
|
||||||
|
$onInit(): void;
|
||||||
|
$onDestroy(): void;
|
||||||
|
onResizeFinish: any;
|
||||||
|
control: any;
|
||||||
|
configureControl(): void;
|
||||||
|
configureDefaults(): void;
|
||||||
|
panel: HTMLElement | null | undefined;
|
||||||
|
resizerColumn: any;
|
||||||
|
currentMinWidth: any;
|
||||||
|
pressed: boolean | undefined;
|
||||||
|
startWidth: any;
|
||||||
|
lastDownX: any;
|
||||||
|
collapsed: boolean | undefined;
|
||||||
|
lastWidth: any;
|
||||||
|
startLeft: number | undefined;
|
||||||
|
lastLeft: any;
|
||||||
|
appFrame: DOMRect | null | undefined;
|
||||||
|
widthBeforeLastDblClick: any;
|
||||||
|
configureRightPanel(): void;
|
||||||
|
getParentRect(): any;
|
||||||
|
reloadDefaultValues(): void;
|
||||||
|
addDoubleClickHandler(): void;
|
||||||
|
addMouseDownListener(): void;
|
||||||
|
addMouseMoveListener(): void;
|
||||||
|
handleWidthEvent(event: any): void;
|
||||||
|
handleLeftEvent(event: any): void;
|
||||||
|
addMouseUpListener(): void;
|
||||||
|
isAtMaxWidth(): any;
|
||||||
|
isCollapsed(): boolean;
|
||||||
|
setWidth(width: any, finish: any): void;
|
||||||
|
setLeft(left: any): void;
|
||||||
|
finishSettingWidth(): void;
|
||||||
|
/**
|
||||||
|
* If an iframe is displayed adjacent to our panel, and the mouse exits over the iframe,
|
||||||
|
* document[onmouseup] is not triggered because the document is no longer the same over
|
||||||
|
* the iframe. We add an invisible overlay while resizing so that the mouse context
|
||||||
|
* remains in our main document.
|
||||||
|
*/
|
||||||
|
addInvisibleOverlay(): void;
|
||||||
|
overlay: any;
|
||||||
|
removeInvisibleOverlay(): void;
|
||||||
|
flash(): void;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
28
app/assets/javascripts/@types/app/assets/javascripts/directives/views/passwordWizard.d.ts
vendored
Normal file
28
app/assets/javascripts/@types/app/assets/javascripts/directives/views/passwordWizard.d.ts
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
export class PasswordWizard {
|
||||||
|
restrict: string;
|
||||||
|
template: any;
|
||||||
|
controller: typeof PasswordWizardCtrl;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: boolean;
|
||||||
|
scope: {
|
||||||
|
type: string;
|
||||||
|
application: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
declare class PasswordWizardCtrl {
|
||||||
|
constructor($element: any, $timeout: any);
|
||||||
|
$element: any;
|
||||||
|
$timeout: any;
|
||||||
|
$onInit(): void;
|
||||||
|
$onDestroy(): void;
|
||||||
|
/** Confirms with user before closing tab */
|
||||||
|
registerWindowUnloadStopper(): void;
|
||||||
|
resetContinueState(): void;
|
||||||
|
isContinuing: boolean | undefined;
|
||||||
|
nextStep(): Promise<void>;
|
||||||
|
setFormDataState(formData: any): Promise<any>;
|
||||||
|
validateCurrentPassword(): Promise<any>;
|
||||||
|
processPasswordChange(): Promise<boolean>;
|
||||||
|
dismiss(): void;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
21
app/assets/javascripts/@types/app/assets/javascripts/directives/views/permissionsModal.d.ts
vendored
Normal file
21
app/assets/javascripts/@types/app/assets/javascripts/directives/views/permissionsModal.d.ts
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
export class PermissionsModal {
|
||||||
|
restrict: string;
|
||||||
|
template: any;
|
||||||
|
controller: typeof PermissionsModalCtrl;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: boolean;
|
||||||
|
scope: {
|
||||||
|
show: string;
|
||||||
|
component: string;
|
||||||
|
permissionsString: string;
|
||||||
|
callback: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
declare class PermissionsModalCtrl {
|
||||||
|
constructor($element: any);
|
||||||
|
$element: any;
|
||||||
|
dismiss(): void;
|
||||||
|
accept(): void;
|
||||||
|
deny(): void;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
32
app/assets/javascripts/@types/app/assets/javascripts/directives/views/privilegesAuthModal.d.ts
vendored
Normal file
32
app/assets/javascripts/@types/app/assets/javascripts/directives/views/privilegesAuthModal.d.ts
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
export class PrivilegesAuthModal {
|
||||||
|
restrict: string;
|
||||||
|
template: any;
|
||||||
|
controller: typeof PrivilegesAuthModalCtrl;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: boolean;
|
||||||
|
scope: {
|
||||||
|
action: string;
|
||||||
|
onSuccess: string;
|
||||||
|
onCancel: string;
|
||||||
|
application: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
declare class PrivilegesAuthModalCtrl {
|
||||||
|
constructor($element: any, $timeout: any);
|
||||||
|
$element: any;
|
||||||
|
$timeout: any;
|
||||||
|
$onInit(): void;
|
||||||
|
authParameters: {} | undefined;
|
||||||
|
sessionLengthOptions: any;
|
||||||
|
selectedSessionLength: any;
|
||||||
|
requiredCredentials: any;
|
||||||
|
selectSessionLength(length: any): void;
|
||||||
|
promptForCredential(credential: any): any;
|
||||||
|
cancel(): void;
|
||||||
|
isCredentialInFailureState(credential: any): boolean;
|
||||||
|
validate(): boolean;
|
||||||
|
failedCredentials: any;
|
||||||
|
submit(): Promise<void>;
|
||||||
|
dismiss(): void;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
export class PrivilegesManagementModal {
|
||||||
|
restrict: string;
|
||||||
|
template: any;
|
||||||
|
controller: typeof PrivilegesManagementModalCtrl;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: boolean;
|
||||||
|
scope: {
|
||||||
|
application: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
declare class PrivilegesManagementModalCtrl {
|
||||||
|
constructor($timeout: any, $element: any);
|
||||||
|
$element: any;
|
||||||
|
onAppLaunch(): void;
|
||||||
|
hasPasscode: any;
|
||||||
|
hasAccount: boolean | undefined;
|
||||||
|
displayInfoForCredential(credential: any): any;
|
||||||
|
displayInfoForAction(action: any): any;
|
||||||
|
isCredentialRequiredForAction(action: any, credential: any): any;
|
||||||
|
clearSession(): Promise<void>;
|
||||||
|
reloadPrivileges(): Promise<void>;
|
||||||
|
availableActions: any;
|
||||||
|
availableCredentials: any;
|
||||||
|
sessionExpirey: any;
|
||||||
|
sessionExpired: boolean | undefined;
|
||||||
|
credentialDisplayInfo: {} | undefined;
|
||||||
|
privileges: any;
|
||||||
|
checkboxValueChanged(action: any, credential: any): void;
|
||||||
|
cancel(): void;
|
||||||
|
dismiss(): void;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
26
app/assets/javascripts/@types/app/assets/javascripts/directives/views/revisionPreviewModal.d.ts
vendored
Normal file
26
app/assets/javascripts/@types/app/assets/javascripts/directives/views/revisionPreviewModal.d.ts
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
export class RevisionPreviewModal {
|
||||||
|
restrict: string;
|
||||||
|
template: any;
|
||||||
|
controller: typeof RevisionPreviewModalCtrl;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: boolean;
|
||||||
|
scope: {
|
||||||
|
uuid: string;
|
||||||
|
content: string;
|
||||||
|
application: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
declare class RevisionPreviewModalCtrl {
|
||||||
|
constructor($element: any, $timeout: any);
|
||||||
|
$element: any;
|
||||||
|
$timeout: any;
|
||||||
|
$onInit(): void;
|
||||||
|
$onDestroy(): void;
|
||||||
|
unregisterComponent: any;
|
||||||
|
configure(): Promise<void>;
|
||||||
|
note: any;
|
||||||
|
editor: any;
|
||||||
|
restore(asCopy: any): void;
|
||||||
|
dismiss(): void;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
28
app/assets/javascripts/@types/app/assets/javascripts/directives/views/sessionHistoryMenu.d.ts
vendored
Normal file
28
app/assets/javascripts/@types/app/assets/javascripts/directives/views/sessionHistoryMenu.d.ts
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
export class SessionHistoryMenu {
|
||||||
|
restrict: string;
|
||||||
|
template: any;
|
||||||
|
controller: typeof SessionHistoryMenuCtrl;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: boolean;
|
||||||
|
scope: {
|
||||||
|
item: string;
|
||||||
|
application: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
declare class SessionHistoryMenuCtrl {
|
||||||
|
constructor($timeout: any);
|
||||||
|
$timeout: any;
|
||||||
|
$onInit(): void;
|
||||||
|
diskEnabled: any;
|
||||||
|
autoOptimize: any;
|
||||||
|
reloadHistory(): void;
|
||||||
|
entries: any;
|
||||||
|
history: any;
|
||||||
|
openRevision(revision: any): void;
|
||||||
|
classForRevision(revision: any): "default" | "success" | "danger" | undefined;
|
||||||
|
clearItemHistory(): void;
|
||||||
|
clearAllHistory(): void;
|
||||||
|
toggleDiskSaving(): void;
|
||||||
|
toggleAutoOptimize(): void;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
21
app/assets/javascripts/@types/app/assets/javascripts/directives/views/syncResolutionMenu.d.ts
vendored
Normal file
21
app/assets/javascripts/@types/app/assets/javascripts/directives/views/syncResolutionMenu.d.ts
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
export class SyncResolutionMenu {
|
||||||
|
restrict: string;
|
||||||
|
template: any;
|
||||||
|
controller: typeof SyncResolutionMenuCtrl;
|
||||||
|
controllerAs: string;
|
||||||
|
bindToController: boolean;
|
||||||
|
scope: {
|
||||||
|
closeFunction: string;
|
||||||
|
application: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
declare class SyncResolutionMenuCtrl {
|
||||||
|
constructor($timeout: any);
|
||||||
|
$timeout: any;
|
||||||
|
status: {};
|
||||||
|
downloadBackup(encrypted: any): void;
|
||||||
|
skipBackup(): void;
|
||||||
|
performSyncResolution(): Promise<void>;
|
||||||
|
close(): void;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
1
app/assets/javascripts/@types/app/assets/javascripts/filters/index.d.ts
vendored
Normal file
1
app/assets/javascripts/@types/app/assets/javascripts/filters/index.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export { trusted } from "./trusted";
|
||||||
1
app/assets/javascripts/@types/app/assets/javascripts/filters/trusted.d.ts
vendored
Normal file
1
app/assets/javascripts/@types/app/assets/javascripts/filters/trusted.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export function trusted($sce: any): (url: any) => any;
|
||||||
1
app/assets/javascripts/@types/app/assets/javascripts/index.d.ts
vendored
Normal file
1
app/assets/javascripts/@types/app/assets/javascripts/index.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export {};
|
||||||
1
app/assets/javascripts/@types/app/assets/javascripts/routes.d.ts
vendored
Normal file
1
app/assets/javascripts/@types/app/assets/javascripts/routes.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export declare function configRoutes($locationProvider: ng.ILocationProvider): void;
|
||||||
6
app/assets/javascripts/@types/app/assets/javascripts/services/alertService.d.ts
vendored
Normal file
6
app/assets/javascripts/@types/app/assets/javascripts/services/alertService.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
export class AlertService extends SNAlertService {
|
||||||
|
constructor(deviceInterface: import("../../../../../snjs/dist/@types").DeviceInterface);
|
||||||
|
alert(title: any, text: any, closeButtonText?: string, onClose: any): Promise<any>;
|
||||||
|
confirm(title: any, text: any, confirmButtonText?: string, cancelButtonText?: string, onConfirm: any, onCancel: any, destructive?: boolean): Promise<any>;
|
||||||
|
}
|
||||||
|
import { SNAlertService } from "../../../../../snjs/dist/@types";
|
||||||
21
app/assets/javascripts/@types/app/assets/javascripts/services/archiveManager.d.ts
vendored
Normal file
21
app/assets/javascripts/@types/app/assets/javascripts/services/archiveManager.d.ts
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
export class ArchiveManager {
|
||||||
|
constructor(application: any);
|
||||||
|
application: any;
|
||||||
|
/** @public */
|
||||||
|
public downloadBackup(encrypted: any): Promise<void>;
|
||||||
|
/** @public */
|
||||||
|
public downloadBackupOfItems(items: any, encrypted: any): Promise<void>;
|
||||||
|
/** @private */
|
||||||
|
private formattedDate;
|
||||||
|
/** @private */
|
||||||
|
private itemsData;
|
||||||
|
/** @private */
|
||||||
|
private loadZip;
|
||||||
|
/** @private */
|
||||||
|
private downloadZippedItems;
|
||||||
|
/** @private */
|
||||||
|
private hrefForData;
|
||||||
|
textFile: string | undefined;
|
||||||
|
/** @private */
|
||||||
|
private downloadData;
|
||||||
|
}
|
||||||
49
app/assets/javascripts/@types/app/assets/javascripts/services/desktopManager.d.ts
vendored
Normal file
49
app/assets/javascripts/@types/app/assets/javascripts/services/desktopManager.d.ts
vendored
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
export class DesktopManager extends ApplicationService {
|
||||||
|
constructor($rootScope: any, $timeout: any, application: any);
|
||||||
|
$rootScope: any;
|
||||||
|
$timeout: any;
|
||||||
|
componentActivationObservers: any[];
|
||||||
|
updateObservers: any[];
|
||||||
|
isDesktop: any;
|
||||||
|
/** @override */
|
||||||
|
onAppEvent(eventName: any): void;
|
||||||
|
dataLoaded: boolean | undefined;
|
||||||
|
saveBackup(): void;
|
||||||
|
getExtServerHost(): any;
|
||||||
|
/**
|
||||||
|
* Sending a component in its raw state is really slow for the desktop app
|
||||||
|
* Keys are not passed into ItemParams, so the result is not encrypted
|
||||||
|
*/
|
||||||
|
convertComponentForTransmission(component: any): Promise<any>;
|
||||||
|
syncComponentsInstallation(components: any): void;
|
||||||
|
installComponent(component: any): Promise<void>;
|
||||||
|
registerUpdateObserver(callback: any): () => void;
|
||||||
|
searchText(text: any): void;
|
||||||
|
lastSearchedText: any;
|
||||||
|
redoSearch(): void;
|
||||||
|
desktop_setSearchHandler(handler: any): void;
|
||||||
|
searchHandler: any;
|
||||||
|
desktop_windowGainedFocus(): void;
|
||||||
|
desktop_windowLostFocus(): void;
|
||||||
|
desktop_onComponentInstallationComplete(componentData: any, error: any): Promise<void>;
|
||||||
|
desktop_registerComponentActivationObserver(callback: any): {
|
||||||
|
id: () => number;
|
||||||
|
callback: any;
|
||||||
|
};
|
||||||
|
desktop_deregisterComponentActivationObserver(observer: any): void;
|
||||||
|
notifyComponentActivation(component: any): Promise<void>;
|
||||||
|
desktop_setExtServerHost(host: any): void;
|
||||||
|
extServerHost: any;
|
||||||
|
desktop_setComponentInstallationSyncHandler(handler: any): void;
|
||||||
|
installationSyncHandler: any;
|
||||||
|
desktop_setInstallComponentHandler(handler: any): void;
|
||||||
|
installComponentHandler: any;
|
||||||
|
desktop_setInitialDataLoadHandler(handler: any): void;
|
||||||
|
dataLoadHandler: any;
|
||||||
|
desktop_requestBackupFile(callback: any): Promise<void>;
|
||||||
|
desktop_setMajorDataChangeHandler(handler: any): void;
|
||||||
|
majorDataChangeHandler: any;
|
||||||
|
desktop_didBeginBackup(): void;
|
||||||
|
desktop_didFinishBackup(success: any): void;
|
||||||
|
}
|
||||||
|
import { ApplicationService } from "../../../../../../../../../../Users/mo/Desktop/sn/dev/snjs/dist/@types";
|
||||||
10
app/assets/javascripts/@types/app/assets/javascripts/services/index.d.ts
vendored
Normal file
10
app/assets/javascripts/@types/app/assets/javascripts/services/index.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
export { AlertService } from "./alertService";
|
||||||
|
export { ArchiveManager } from "./archiveManager";
|
||||||
|
export { DesktopManager } from "./desktopManager";
|
||||||
|
export { KeyboardManager } from "./keyboardManager";
|
||||||
|
export { LockManager } from "./lockManager";
|
||||||
|
export { NativeExtManager } from "./nativeExtManager";
|
||||||
|
export { PreferencesManager } from "./preferencesManager";
|
||||||
|
export { StatusManager } from "./statusManager";
|
||||||
|
export { ThemeManager } from "./themeManager";
|
||||||
|
export { AppState } from "./state";
|
||||||
42
app/assets/javascripts/@types/app/assets/javascripts/services/keyboardManager.d.ts
vendored
Normal file
42
app/assets/javascripts/@types/app/assets/javascripts/services/keyboardManager.d.ts
vendored
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
export namespace KeyboardKeys {
|
||||||
|
export const Tab: string;
|
||||||
|
export const Backspace: string;
|
||||||
|
export const Up: string;
|
||||||
|
export const Down: string;
|
||||||
|
}
|
||||||
|
export namespace KeyboardModifiers {
|
||||||
|
export const Shift: string;
|
||||||
|
export const Ctrl: string;
|
||||||
|
export const Meta: string;
|
||||||
|
export const Alt: string;
|
||||||
|
}
|
||||||
|
export class KeyboardManager {
|
||||||
|
observers: any[];
|
||||||
|
handleKeyDown(event: any): void;
|
||||||
|
handleKeyUp(event: any): void;
|
||||||
|
/** @access public */
|
||||||
|
deinit(): void;
|
||||||
|
modifiersForEvent(event: any): any[];
|
||||||
|
eventMatchesKeyAndModifiers(event: any, key: any, modifiers?: any[]): boolean;
|
||||||
|
notifyObserver(event: any, keyEventType: any): void;
|
||||||
|
addKeyObserver({ key, modifiers, onKeyDown, onKeyUp, element, elements, notElement, notElementIds }: {
|
||||||
|
key: any;
|
||||||
|
modifiers: any;
|
||||||
|
onKeyDown: any;
|
||||||
|
onKeyUp: any;
|
||||||
|
element: any;
|
||||||
|
elements: any;
|
||||||
|
notElement: any;
|
||||||
|
notElementIds: any;
|
||||||
|
}): {
|
||||||
|
key: any;
|
||||||
|
modifiers: any;
|
||||||
|
onKeyDown: any;
|
||||||
|
onKeyUp: any;
|
||||||
|
element: any;
|
||||||
|
elements: any;
|
||||||
|
notElement: any;
|
||||||
|
notElementIds: any;
|
||||||
|
};
|
||||||
|
removeKeyObserver(observer: any): void;
|
||||||
|
}
|
||||||
25
app/assets/javascripts/@types/app/assets/javascripts/services/lockManager.d.ts
vendored
Normal file
25
app/assets/javascripts/@types/app/assets/javascripts/services/lockManager.d.ts
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
export class LockManager {
|
||||||
|
constructor(application: any);
|
||||||
|
application: any;
|
||||||
|
observeVisibility(): void;
|
||||||
|
unsubState: any;
|
||||||
|
deinit(): void;
|
||||||
|
setAutoLockInterval(interval: any): Promise<any>;
|
||||||
|
getAutoLockInterval(): Promise<any>;
|
||||||
|
/**
|
||||||
|
* Verify document is in focus every so often as visibilitychange event is
|
||||||
|
* not triggered on a typical window blur event but rather on tab changes.
|
||||||
|
*/
|
||||||
|
beginWebFocusPolling(): void;
|
||||||
|
pollFocusInterval: NodeJS.Timeout | undefined;
|
||||||
|
lastFocusState: string | undefined;
|
||||||
|
getAutoLockIntervalOptions(): {
|
||||||
|
value: number;
|
||||||
|
label: string;
|
||||||
|
}[];
|
||||||
|
documentVisibilityChanged(visible: any): Promise<void>;
|
||||||
|
beginAutoLockTimer(): Promise<void>;
|
||||||
|
lockAfterDate: Date | null | undefined;
|
||||||
|
lockTimeout: NodeJS.Timeout | undefined;
|
||||||
|
cancelAutoLockTimer(): void;
|
||||||
|
}
|
||||||
17
app/assets/javascripts/@types/app/assets/javascripts/services/nativeExtManager.d.ts
vendored
Normal file
17
app/assets/javascripts/@types/app/assets/javascripts/services/nativeExtManager.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
/** A class for handling installation of system extensions */
|
||||||
|
export class NativeExtManager extends ApplicationService {
|
||||||
|
constructor(application: any);
|
||||||
|
extManagerId: string;
|
||||||
|
batchManagerId: string;
|
||||||
|
/** @override */
|
||||||
|
onAppLaunch(): void;
|
||||||
|
get extManagerPred(): SNPredicate;
|
||||||
|
get batchManagerPred(): SNPredicate;
|
||||||
|
reload(): void;
|
||||||
|
resolveExtensionsManager(): Promise<void>;
|
||||||
|
extensionsManagerTemplatePayload(): import("../../../../../snjs/dist/@types/protocol/payloads/pure_payload").PurePayload | undefined;
|
||||||
|
batchManagerTemplatePayload(): import("../../../../../snjs/dist/@types/protocol/payloads/pure_payload").PurePayload | undefined;
|
||||||
|
resolveBatchManager(): Promise<void>;
|
||||||
|
}
|
||||||
|
import { ApplicationService } from "../../../../../../../../../../Users/mo/Desktop/sn/dev/snjs/dist/@types";
|
||||||
|
import { SNPredicate } from "../../../../../../../../../../Users/mo/Desktop/sn/dev/snjs/dist/@types";
|
||||||
29
app/assets/javascripts/@types/app/assets/javascripts/services/preferencesManager.d.ts
vendored
Normal file
29
app/assets/javascripts/@types/app/assets/javascripts/services/preferencesManager.d.ts
vendored
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
export namespace PrefKeys {
|
||||||
|
export const TagsPanelWidth: string;
|
||||||
|
export const NotesPanelWidth: string;
|
||||||
|
export const EditorWidth: string;
|
||||||
|
export const EditorLeft: string;
|
||||||
|
export const EditorMonospaceEnabled: string;
|
||||||
|
export const EditorSpellcheck: string;
|
||||||
|
export const EditorResizersEnabled: string;
|
||||||
|
export const SortNotesBy: string;
|
||||||
|
export const SortNotesReverse: string;
|
||||||
|
export const NotesShowArchived: string;
|
||||||
|
export const NotesHidePinned: string;
|
||||||
|
export const NotesHideNotePreview: string;
|
||||||
|
export const NotesHideDate: string;
|
||||||
|
export const NotesHideTags: string;
|
||||||
|
}
|
||||||
|
export class PreferencesManager extends ApplicationService {
|
||||||
|
constructor(application: import("../../../../../snjs/dist/@types/application").SNApplication);
|
||||||
|
/** @override */
|
||||||
|
onAppLaunch(): void;
|
||||||
|
streamPreferences(): void;
|
||||||
|
loadSingleton(): Promise<void>;
|
||||||
|
userPreferences: any;
|
||||||
|
preferencesDidChange(): void;
|
||||||
|
syncUserPreferences(): void;
|
||||||
|
getValue(key: any, defaultValue: any): any;
|
||||||
|
setUserPrefValue(key: any, value: any, sync: any): void;
|
||||||
|
}
|
||||||
|
import { ApplicationService } from "../../../../../../../../../../Users/mo/Desktop/sn/dev/snjs/dist/@types";
|
||||||
56
app/assets/javascripts/@types/app/assets/javascripts/services/state.d.ts
vendored
Normal file
56
app/assets/javascripts/@types/app/assets/javascripts/services/state.d.ts
vendored
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
export namespace AppStateEvents {
|
||||||
|
export const TagChanged: number;
|
||||||
|
export const NoteChanged: number;
|
||||||
|
export const PreferencesChanged: number;
|
||||||
|
export const PanelResized: number;
|
||||||
|
export const EditorFocused: number;
|
||||||
|
export const BeganBackupDownload: number;
|
||||||
|
export const EndedBackupDownload: number;
|
||||||
|
export const DesktopExtsReady: number;
|
||||||
|
export const WindowDidFocus: number;
|
||||||
|
export const WindowDidBlur: number;
|
||||||
|
}
|
||||||
|
export namespace EventSources {
|
||||||
|
export const UserInteraction: number;
|
||||||
|
export const Script: number;
|
||||||
|
}
|
||||||
|
export class AppState {
|
||||||
|
constructor($rootScope: any, $timeout: any, application: any);
|
||||||
|
$timeout: any;
|
||||||
|
$rootScope: any;
|
||||||
|
application: any;
|
||||||
|
observers: any[];
|
||||||
|
locked: boolean;
|
||||||
|
deinit(): void;
|
||||||
|
unsubApp: any;
|
||||||
|
rootScopeCleanup1: any;
|
||||||
|
rootScopeCleanup2: any;
|
||||||
|
onVisibilityChange(): void;
|
||||||
|
addAppEventObserver(): void;
|
||||||
|
isLocked(): boolean;
|
||||||
|
registerVisibilityObservers(): void;
|
||||||
|
/** @returns A function that unregisters this observer */
|
||||||
|
addObserver(callback: any): () => void;
|
||||||
|
notifyEvent(eventName: any, data: any): Promise<any>;
|
||||||
|
setSelectedTag(tag: any): void;
|
||||||
|
selectedTag: any;
|
||||||
|
setSelectedNote(note: any): Promise<any>;
|
||||||
|
selectedNote: any;
|
||||||
|
getSelectedTag(): any;
|
||||||
|
getSelectedNote(): any;
|
||||||
|
setUserPreferences(preferences: any): void;
|
||||||
|
userPreferences: any;
|
||||||
|
panelDidResize({ name, collapsed }: {
|
||||||
|
name: any;
|
||||||
|
collapsed: any;
|
||||||
|
}): void;
|
||||||
|
editorDidFocus(eventSource: any): void;
|
||||||
|
beganBackupDownload(): void;
|
||||||
|
endedBackupDownload({ success }: {
|
||||||
|
success: any;
|
||||||
|
}): void;
|
||||||
|
/**
|
||||||
|
* When the desktop appplication extension server is ready.
|
||||||
|
*/
|
||||||
|
desktopExtensionsReady(): void;
|
||||||
|
}
|
||||||
15
app/assets/javascripts/@types/app/assets/javascripts/services/statusManager.d.ts
vendored
Normal file
15
app/assets/javascripts/@types/app/assets/javascripts/services/statusManager.d.ts
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
export class StatusManager {
|
||||||
|
statuses: any[];
|
||||||
|
observers: any[];
|
||||||
|
statusFromString(string: any): {
|
||||||
|
string: any;
|
||||||
|
};
|
||||||
|
replaceStatusWithString(status: any, string: any): any;
|
||||||
|
addStatusFromString(string: any): any;
|
||||||
|
addStatus(status: any): any;
|
||||||
|
removeStatus(status: any): null;
|
||||||
|
getStatusString(): string;
|
||||||
|
notifyObservers(): void;
|
||||||
|
addStatusObserver(callback: any): void;
|
||||||
|
removeStatusObserver(callback: any): void;
|
||||||
|
}
|
||||||
26
app/assets/javascripts/@types/app/assets/javascripts/services/themeManager.d.ts
vendored
Normal file
26
app/assets/javascripts/@types/app/assets/javascripts/services/themeManager.d.ts
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
export class ThemeManager extends ApplicationService {
|
||||||
|
constructor(application: any);
|
||||||
|
activeThemes: any[];
|
||||||
|
unsubState: any;
|
||||||
|
unregisterDesktop: any;
|
||||||
|
unregisterComponent: any;
|
||||||
|
/** @override */
|
||||||
|
onAppStart(): void;
|
||||||
|
/** @access private */
|
||||||
|
activateCachedThemes(): Promise<void>;
|
||||||
|
/** @access private */
|
||||||
|
registerObservers(): void;
|
||||||
|
/** @access public */
|
||||||
|
deactivateAllThemes(): void;
|
||||||
|
/** @access private */
|
||||||
|
activateTheme(theme: any, writeToCache?: boolean): void;
|
||||||
|
/** @access private */
|
||||||
|
deactivateTheme(theme: any): void;
|
||||||
|
/** @access private */
|
||||||
|
cacheThemes(): Promise<void>;
|
||||||
|
/** @access private */
|
||||||
|
decacheThemes(): Promise<void>;
|
||||||
|
/** @access private */
|
||||||
|
getCachedThemes(): Promise<import("../../../../../snjs/dist/@types/models/core/item").SNItem[]>;
|
||||||
|
}
|
||||||
|
import { ApplicationService } from "../../../../../../../../../../Users/mo/Desktop/sn/dev/snjs/dist/@types";
|
||||||
43
app/assets/javascripts/@types/app/assets/javascripts/strings.d.ts
vendored
Normal file
43
app/assets/javascripts/@types/app/assets/javascripts/strings.d.ts
vendored
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
export function StringSyncException(data: any): string;
|
||||||
|
export function StringDeleteNote({ title, permanently }: {
|
||||||
|
title: any;
|
||||||
|
permanently: any;
|
||||||
|
}): string;
|
||||||
|
export function StringEmptyTrash({ count }: {
|
||||||
|
count: any;
|
||||||
|
}): string;
|
||||||
|
export function StringImportError({ errorCount }: {
|
||||||
|
errorCount: any;
|
||||||
|
}): string;
|
||||||
|
/** @generic */
|
||||||
|
export const STRING_SESSION_EXPIRED: "Your session has expired. New changes will not be pulled in. Please sign out and sign back in to refresh your session.";
|
||||||
|
export const STRING_DEFAULT_FILE_ERROR: "Please use FileSafe or the Bold Editor to attach images and files. Learn more at standardnotes.org/filesafe.";
|
||||||
|
export const STRING_GENERIC_SYNC_ERROR: "There was an error syncing. Please try again. If all else fails, try signing out and signing back in.";
|
||||||
|
/** @footer */
|
||||||
|
export const STRING_NEW_UPDATE_READY: "A new update is ready to install. Please use the top-level 'Updates' menu to manage installation.";
|
||||||
|
/** @tags */
|
||||||
|
export const STRING_DELETE_TAG: "Are you sure you want to delete this tag? Note: deleting a tag will not delete its notes.";
|
||||||
|
/** @editor */
|
||||||
|
export const STRING_DELETED_NOTE: "The note you are attempting to edit has been deleted, and is awaiting sync. Changes you make will be disregarded.";
|
||||||
|
export const STRING_INVALID_NOTE: "The note you are attempting to save can not be found or has been deleted. Changes you make will not be synced. Please copy this note's text and start a new note.";
|
||||||
|
export const STRING_ELLIPSES: "...";
|
||||||
|
export const STRING_GENERIC_SAVE_ERROR: "There was an error saving your note. Please try again.";
|
||||||
|
export const STRING_DELETE_PLACEHOLDER_ATTEMPT: "This note is a placeholder and cannot be deleted. To remove from your list, simply navigate to a different note.";
|
||||||
|
export const STRING_DELETE_LOCKED_ATTEMPT: "This note is locked. If you'd like to delete it, unlock it, and try again.";
|
||||||
|
/** @account */
|
||||||
|
export const STRING_ACCOUNT_MENU_UNCHECK_MERGE: "Unchecking this option means any of the notes you have written while you were signed out will be deleted. Are you sure you want to discard these notes?";
|
||||||
|
export const STRING_SIGN_OUT_CONFIRMATION: "Are you sure you want to end your session? This will delete all local items and extensions.";
|
||||||
|
export const STRING_ERROR_DECRYPTING_IMPORT: "There was an error decrypting your items. Make sure the password you entered is correct and try again.";
|
||||||
|
export const STRING_E2E_ENABLED: "End-to-end encryption is enabled. Your data is encrypted on your device first, then synced to your private cloud.";
|
||||||
|
export const STRING_LOCAL_ENC_ENABLED: "Encryption is enabled. Your data is encrypted using your passcode before it is saved to your device storage.";
|
||||||
|
export const STRING_ENC_NOT_ENABLED: "Encryption is not enabled. Sign in, register, or add a passcode lock to enable encryption.";
|
||||||
|
export const STRING_IMPORT_SUCCESS: "Your data has been successfully imported.";
|
||||||
|
export const STRING_REMOVE_PASSCODE_CONFIRMATION: "Are you sure you want to remove your application passcode?";
|
||||||
|
export const STRING_REMOVE_PASSCODE_OFFLINE_ADDENDUM: " This will remove encryption from your local data.";
|
||||||
|
export const STRING_NON_MATCHING_PASSCODES: "The two passcodes you entered do not match. Please try again.";
|
||||||
|
export const STRING_NON_MATCHING_PASSWORDS: "The two passwords you entered do not match. Please try again.";
|
||||||
|
export const STRING_GENERATING_LOGIN_KEYS: "Generating Login Keys...";
|
||||||
|
export const STRING_GENERATING_REGISTER_KEYS: "Generating Account Keys...";
|
||||||
|
export const STRING_INVALID_IMPORT_FILE: "Unable to open file. Ensure it is a proper JSON file and try again.";
|
||||||
|
/** @password_change */
|
||||||
|
export const STRING_FAILED_PASSWORD_CHANGE: "There was an error re-encrypting your items. Your password was changed, but not all your items were properly re-encrypted and synced. You should try syncing again. If all else fails, you should restore your notes from backup.";
|
||||||
4
app/assets/javascripts/@types/app/assets/javascripts/types.d.ts
vendored
Normal file
4
app/assets/javascripts/@types/app/assets/javascripts/types.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export declare enum PasswordWizardType {
|
||||||
|
ChangePassword = 1,
|
||||||
|
AccountUpgrade = 2
|
||||||
|
}
|
||||||
10
app/assets/javascripts/@types/app/assets/javascripts/utils.d.ts
vendored
Normal file
10
app/assets/javascripts/@types/app/assets/javascripts/utils.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
export function getParameterByName(name: any, url: any): string | null;
|
||||||
|
export function parametersFromURL(url: any): {};
|
||||||
|
export function isNullOrUndefined(value: any): boolean;
|
||||||
|
export function dictToArray(dict: any): any[];
|
||||||
|
export function humanReadableList(array: any): string;
|
||||||
|
export function getPlatformString(): string;
|
||||||
|
export function dateToLocalizedString(date: any): any;
|
||||||
|
/** Via https://davidwalsh.name/javascript-debounce-function */
|
||||||
|
export function debounce(func: any, wait: any, immediate: any): (...args: any[]) => void;
|
||||||
|
export function isDesktopApplication(): any;
|
||||||
29
app/assets/javascripts/@types/app/assets/javascripts/web_device_interface.d.ts
vendored
Normal file
29
app/assets/javascripts/@types/app/assets/javascripts/web_device_interface.d.ts
vendored
Normal 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<any>;
|
||||||
|
saveRawDatabasePayloads(payloads: any[]): Promise<any>;
|
||||||
|
removeRawDatabasePayloadWithId(id: string): Promise<any>;
|
||||||
|
removeAllRawDatabasePayloads(): Promise<any>;
|
||||||
|
getKeychainValue(): Promise<any>;
|
||||||
|
setKeychainValue(value: any): Promise<void>;
|
||||||
|
clearKeychainValue(): Promise<void>;
|
||||||
|
openUrl(url: string): void;
|
||||||
|
}
|
||||||
242
app/assets/javascripts/@types/vendor/assets/javascripts/angular-sanitize.d.ts
vendored
Normal file
242
app/assets/javascripts/@types/vendor/assets/javascripts/angular-sanitize.d.ts
vendored
Normal file
@@ -0,0 +1,242 @@
|
|||||||
|
/**
|
||||||
|
* @ngdoc module
|
||||||
|
* @name ngSanitize
|
||||||
|
* @description
|
||||||
|
*
|
||||||
|
* The `ngSanitize` module provides functionality to sanitize HTML.
|
||||||
|
*
|
||||||
|
* See {@link ngSanitize.$sanitize `$sanitize`} for usage.
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @ngdoc service
|
||||||
|
* @name $sanitize
|
||||||
|
* @kind function
|
||||||
|
*
|
||||||
|
* @description
|
||||||
|
* Sanitizes an html string by stripping all potentially dangerous tokens.
|
||||||
|
*
|
||||||
|
* The input is sanitized by parsing the HTML into tokens. All safe tokens (from a whitelist) are
|
||||||
|
* then serialized back to a properly escaped HTML string. This means that no unsafe input can make
|
||||||
|
* it into the returned string.
|
||||||
|
*
|
||||||
|
* The whitelist for URL sanitization of attribute values is configured using the functions
|
||||||
|
* `aHrefSanitizationWhitelist` and `imgSrcSanitizationWhitelist` of {@link $compileProvider}.
|
||||||
|
*
|
||||||
|
* The input may also contain SVG markup if this is enabled via {@link $sanitizeProvider}.
|
||||||
|
*
|
||||||
|
* @param {string} html HTML input.
|
||||||
|
* @returns {string} Sanitized HTML.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
<example module="sanitizeExample" deps="angular-sanitize.js" name="sanitize-service">
|
||||||
|
<file name="index.html">
|
||||||
|
<script>
|
||||||
|
angular.module('sanitizeExample', ['ngSanitize'])
|
||||||
|
.controller('ExampleController', ['$scope', '$sce', function($scope, $sce) {
|
||||||
|
$scope.snippet =
|
||||||
|
'<p style="color:blue">an html\n' +
|
||||||
|
'<em onmouseover="this.textContent=\'PWN3D!\'">click here</em>\n' +
|
||||||
|
'snippet</p>';
|
||||||
|
$scope.deliberatelyTrustDangerousSnippet = function() {
|
||||||
|
return $sce.trustAsHtml($scope.snippet);
|
||||||
|
};
|
||||||
|
}]);
|
||||||
|
</script>
|
||||||
|
<div ng-controller="ExampleController">
|
||||||
|
Snippet: <textarea ng-model="snippet" cols="60" rows="3"></textarea>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>Directive</td>
|
||||||
|
<td>How</td>
|
||||||
|
<td>Source</td>
|
||||||
|
<td>Rendered</td>
|
||||||
|
</tr>
|
||||||
|
<tr id="bind-html-with-sanitize">
|
||||||
|
<td>ng-bind-html</td>
|
||||||
|
<td>Automatically uses $sanitize</td>
|
||||||
|
<td><pre><div ng-bind-html="snippet"><br/></div></pre></td>
|
||||||
|
<td><div ng-bind-html="snippet"></div></td>
|
||||||
|
</tr>
|
||||||
|
<tr id="bind-html-with-trust">
|
||||||
|
<td>ng-bind-html</td>
|
||||||
|
<td>Bypass $sanitize by explicitly trusting the dangerous value</td>
|
||||||
|
<td>
|
||||||
|
<pre><div ng-bind-html="deliberatelyTrustDangerousSnippet()">
|
||||||
|
</div></pre>
|
||||||
|
</td>
|
||||||
|
<td><div ng-bind-html="deliberatelyTrustDangerousSnippet()"></div></td>
|
||||||
|
</tr>
|
||||||
|
<tr id="bind-default">
|
||||||
|
<td>ng-bind</td>
|
||||||
|
<td>Automatically escapes</td>
|
||||||
|
<td><pre><div ng-bind="snippet"><br/></div></pre></td>
|
||||||
|
<td><div ng-bind="snippet"></div></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</file>
|
||||||
|
<file name="protractor.js" type="protractor">
|
||||||
|
it('should sanitize the html snippet by default', function() {
|
||||||
|
expect(element(by.css('#bind-html-with-sanitize div')).getAttribute('innerHTML')).
|
||||||
|
toBe('<p>an html\n<em>click here</em>\nsnippet</p>');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should inline raw snippet if bound to a trusted value', function() {
|
||||||
|
expect(element(by.css('#bind-html-with-trust div')).getAttribute('innerHTML')).
|
||||||
|
toBe("<p style=\"color:blue\">an html\n" +
|
||||||
|
"<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" +
|
||||||
|
"snippet</p>");
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should escape snippet without any filter', function() {
|
||||||
|
expect(element(by.css('#bind-default div')).getAttribute('innerHTML')).
|
||||||
|
toBe("<p style=\"color:blue\">an html\n" +
|
||||||
|
"<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" +
|
||||||
|
"snippet</p>");
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should update', function() {
|
||||||
|
element(by.model('snippet')).clear();
|
||||||
|
element(by.model('snippet')).sendKeys('new <b onclick="alert(1)">text</b>');
|
||||||
|
expect(element(by.css('#bind-html-with-sanitize div')).getAttribute('innerHTML')).
|
||||||
|
toBe('new <b>text</b>');
|
||||||
|
expect(element(by.css('#bind-html-with-trust div')).getAttribute('innerHTML')).toBe(
|
||||||
|
'new <b onclick="alert(1)">text</b>');
|
||||||
|
expect(element(by.css('#bind-default div')).getAttribute('innerHTML')).toBe(
|
||||||
|
"new <b onclick=\"alert(1)\">text</b>");
|
||||||
|
});
|
||||||
|
</file>
|
||||||
|
</example>
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @ngdoc provider
|
||||||
|
* @name $sanitizeProvider
|
||||||
|
* @this
|
||||||
|
*
|
||||||
|
* @description
|
||||||
|
* Creates and configures {@link $sanitize} instance.
|
||||||
|
*/
|
||||||
|
declare function $SanitizeProvider(): void;
|
||||||
|
declare class $SanitizeProvider {
|
||||||
|
$get: (string | (($$sanitizeUri: any) => (html: any) => string))[];
|
||||||
|
/**
|
||||||
|
* @ngdoc method
|
||||||
|
* @name $sanitizeProvider#enableSvg
|
||||||
|
* @kind function
|
||||||
|
*
|
||||||
|
* @description
|
||||||
|
* Enables a subset of svg to be supported by the sanitizer.
|
||||||
|
*
|
||||||
|
* <div class="alert alert-warning">
|
||||||
|
* <p>By enabling this setting without taking other precautions, you might expose your
|
||||||
|
* application to click-hijacking attacks. In these attacks, sanitized svg elements could be positioned
|
||||||
|
* outside of the containing element and be rendered over other elements on the page (e.g. a login
|
||||||
|
* link). Such behavior can then result in phishing incidents.</p>
|
||||||
|
*
|
||||||
|
* <p>To protect against these, explicitly setup `overflow: hidden` css rule for all potential svg
|
||||||
|
* tags within the sanitized content:</p>
|
||||||
|
*
|
||||||
|
* <br>
|
||||||
|
*
|
||||||
|
* <pre><code>
|
||||||
|
* .rootOfTheIncludedContent svg {
|
||||||
|
* overflow: hidden !important;
|
||||||
|
* }
|
||||||
|
* </code></pre>
|
||||||
|
* </div>
|
||||||
|
*
|
||||||
|
* @param {boolean=} flag Enable or disable SVG support in the sanitizer.
|
||||||
|
* @returns {boolean|$sanitizeProvider} Returns the currently configured value if called
|
||||||
|
* without an argument or self for chaining otherwise.
|
||||||
|
*/
|
||||||
|
enableSvg: (enableSvg: any) => any;
|
||||||
|
/**
|
||||||
|
* @ngdoc method
|
||||||
|
* @name $sanitizeProvider#addValidElements
|
||||||
|
* @kind function
|
||||||
|
*
|
||||||
|
* @description
|
||||||
|
* Extends the built-in lists of valid HTML/SVG elements, i.e. elements that are considered safe
|
||||||
|
* and are not stripped off during sanitization. You can extend the following lists of elements:
|
||||||
|
*
|
||||||
|
* - `htmlElements`: A list of elements (tag names) to extend the current list of safe HTML
|
||||||
|
* elements. HTML elements considered safe will not be removed during sanitization. All other
|
||||||
|
* elements will be stripped off.
|
||||||
|
*
|
||||||
|
* - `htmlVoidElements`: This is similar to `htmlElements`, but marks the elements as
|
||||||
|
* "void elements" (similar to HTML
|
||||||
|
* [void elements](https://rawgit.com/w3c/html/html5.1-2/single-page.html#void-elements)). These
|
||||||
|
* elements have no end tag and cannot have content.
|
||||||
|
*
|
||||||
|
* - `svgElements`: This is similar to `htmlElements`, but for SVG elements. This list is only
|
||||||
|
* taken into account if SVG is {@link ngSanitize.$sanitizeProvider#enableSvg enabled} for
|
||||||
|
* `$sanitize`.
|
||||||
|
*
|
||||||
|
* <div class="alert alert-info">
|
||||||
|
* This method must be called during the {@link angular.Module#config config} phase. Once the
|
||||||
|
* `$sanitize` service has been instantiated, this method has no effect.
|
||||||
|
* </div>
|
||||||
|
*
|
||||||
|
* <div class="alert alert-warning">
|
||||||
|
* Keep in mind that extending the built-in lists of elements may expose your app to XSS or
|
||||||
|
* other vulnerabilities. Be very mindful of the elements you add.
|
||||||
|
* </div>
|
||||||
|
*
|
||||||
|
* @param {Array<String>|Object} elements - A list of valid HTML elements or an object with one or
|
||||||
|
* more of the following properties:
|
||||||
|
* - **htmlElements** - `{Array<String>}` - A list of elements to extend the current list of
|
||||||
|
* HTML elements.
|
||||||
|
* - **htmlVoidElements** - `{Array<String>}` - A list of elements to extend the current list of
|
||||||
|
* void HTML elements; i.e. elements that do not have an end tag.
|
||||||
|
* - **svgElements** - `{Array<String>}` - A list of elements to extend the current list of SVG
|
||||||
|
* elements. The list of SVG elements is only taken into account if SVG is
|
||||||
|
* {@link ngSanitize.$sanitizeProvider#enableSvg enabled} for `$sanitize`.
|
||||||
|
*
|
||||||
|
* Passing an array (`[...]`) is equivalent to passing `{htmlElements: [...]}`.
|
||||||
|
*
|
||||||
|
* @return {$sanitizeProvider} Returns self for chaining.
|
||||||
|
*/
|
||||||
|
addValidElements: (elements: Object | string[]) => any;
|
||||||
|
/**
|
||||||
|
* @ngdoc method
|
||||||
|
* @name $sanitizeProvider#addValidAttrs
|
||||||
|
* @kind function
|
||||||
|
*
|
||||||
|
* @description
|
||||||
|
* Extends the built-in list of valid attributes, i.e. attributes that are considered safe and are
|
||||||
|
* not stripped off during sanitization.
|
||||||
|
*
|
||||||
|
* **Note**:
|
||||||
|
* The new attributes will not be treated as URI attributes, which means their values will not be
|
||||||
|
* sanitized as URIs using `$compileProvider`'s
|
||||||
|
* {@link ng.$compileProvider#aHrefSanitizationWhitelist aHrefSanitizationWhitelist} and
|
||||||
|
* {@link ng.$compileProvider#imgSrcSanitizationWhitelist imgSrcSanitizationWhitelist}.
|
||||||
|
*
|
||||||
|
* <div class="alert alert-info">
|
||||||
|
* This method must be called during the {@link angular.Module#config config} phase. Once the
|
||||||
|
* `$sanitize` service has been instantiated, this method has no effect.
|
||||||
|
* </div>
|
||||||
|
*
|
||||||
|
* <div class="alert alert-warning">
|
||||||
|
* Keep in mind that extending the built-in list of attributes may expose your app to XSS or
|
||||||
|
* other vulnerabilities. Be very mindful of the attributes you add.
|
||||||
|
* </div>
|
||||||
|
*
|
||||||
|
* @param {Array<String>} attrs - A list of valid attributes.
|
||||||
|
*
|
||||||
|
* @returns {$sanitizeProvider} Returns self for chaining.
|
||||||
|
*/
|
||||||
|
addValidAttrs: (attrs: string[]) => any;
|
||||||
|
}
|
||||||
|
declare function sanitizeText(chars: any): string;
|
||||||
|
declare var $sanitizeMinErr: any;
|
||||||
|
declare var bind: any;
|
||||||
|
declare var extend: any;
|
||||||
|
declare var forEach: any;
|
||||||
|
declare var isArray: any;
|
||||||
|
declare var isDefined: any;
|
||||||
|
declare var lowercase: any;
|
||||||
|
declare var noop: any;
|
||||||
|
declare var nodeContains: any;
|
||||||
|
declare var htmlParser: any;
|
||||||
|
declare var htmlSanitizeWriter: any;
|
||||||
0
app/assets/javascripts/@types/vendor/assets/javascripts/zip/deflate.d.ts
vendored
Normal file
0
app/assets/javascripts/@types/vendor/assets/javascripts/zip/deflate.d.ts
vendored
Normal file
0
app/assets/javascripts/@types/vendor/assets/javascripts/zip/inflate.d.ts
vendored
Normal file
0
app/assets/javascripts/@types/vendor/assets/javascripts/zip/inflate.d.ts
vendored
Normal file
0
app/assets/javascripts/@types/vendor/assets/javascripts/zip/z-worker.d.ts
vendored
Normal file
0
app/assets/javascripts/@types/vendor/assets/javascripts/zip/z-worker.d.ts
vendored
Normal file
0
app/assets/javascripts/@types/vendor/assets/javascripts/zip/zip.d.ts
vendored
Normal file
0
app/assets/javascripts/@types/vendor/assets/javascripts/zip/zip.d.ts
vendored
Normal file
@@ -1,30 +1,61 @@
|
|||||||
|
import { PasswordWizardType } from './types';
|
||||||
import {
|
import {
|
||||||
|
Environment,
|
||||||
SNApplication,
|
SNApplication,
|
||||||
SNAlertService,
|
SNAlertService,
|
||||||
Environments,
|
platformFromString,
|
||||||
platformFromString
|
Challenge,
|
||||||
|
ChallengeOrchestrator,
|
||||||
|
ProtectedAction
|
||||||
} from 'snjs';
|
} from 'snjs';
|
||||||
import angular from 'angular';
|
import angular from 'angular';
|
||||||
import { getPlatformString } from '@/utils';
|
import { getPlatformString } from '@/utils';
|
||||||
import { AlertService } from '@/services/alertService';
|
import { AlertService } from '@/services/alertService';
|
||||||
import { WebDeviceInterface } from '@/web_device_interface';
|
import { WebDeviceInterface } from '@/web_device_interface';
|
||||||
|
import { AppState, DesktopManager, LockManager, ArchiveManager, NativeExtManager, StatusManager, ThemeManager, PreferencesManager, KeyboardManager } from './services';
|
||||||
|
|
||||||
|
type WebServices = {
|
||||||
|
appState: AppState
|
||||||
|
desktopService: DesktopManager
|
||||||
|
lockService: LockManager
|
||||||
|
archiveService: ArchiveManager
|
||||||
|
nativeExtService: NativeExtManager
|
||||||
|
statusService: StatusManager
|
||||||
|
themeService: ThemeManager
|
||||||
|
prefsService: PreferencesManager
|
||||||
|
keyboardService: KeyboardManager
|
||||||
|
}
|
||||||
|
|
||||||
export class WebApplication extends SNApplication {
|
export class WebApplication extends SNApplication {
|
||||||
|
|
||||||
|
private $compile?: ng.ICompileService
|
||||||
|
private scope?: ng.IScope
|
||||||
|
private onDeinit?: (app: SNApplication) => void
|
||||||
|
private webServices!: WebServices
|
||||||
|
private currentAuthenticationElement?: JQLite
|
||||||
|
|
||||||
/* @ngInject */
|
/* @ngInject */
|
||||||
constructor($compile, $timeout, scope, onDeinit) {
|
constructor(
|
||||||
const deviceInterface = new WebDeviceInterface({ timeout: $timeout });
|
$compile: ng.ICompileService,
|
||||||
super({
|
$timeout: ng.ITimeoutService,
|
||||||
environment: Environments.Web,
|
scope: ng.IScope,
|
||||||
platform: platformFromString(getPlatformString()),
|
onDeinit: () => void
|
||||||
namespace: '',
|
) {
|
||||||
deviceInterface: deviceInterface,
|
const namespace = '';
|
||||||
swapClasses: [
|
const deviceInterface = new WebDeviceInterface(namespace, $timeout);
|
||||||
|
super(
|
||||||
|
Environment.Web,
|
||||||
|
platformFromString(getPlatformString()),
|
||||||
|
deviceInterface,
|
||||||
|
namespace,
|
||||||
|
undefined,
|
||||||
|
[
|
||||||
{
|
{
|
||||||
swap: SNAlertService,
|
swap: SNAlertService,
|
||||||
with: AlertService
|
with: AlertService
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
);
|
||||||
this.$compile = $compile;
|
this.$compile = $compile;
|
||||||
this.scope = scope;
|
this.scope = scope;
|
||||||
this.onDeinit = onDeinit;
|
this.onDeinit = onDeinit;
|
||||||
@@ -34,30 +65,23 @@ export class WebApplication extends SNApplication {
|
|||||||
/** @override */
|
/** @override */
|
||||||
deinit() {
|
deinit() {
|
||||||
for (const key of Object.keys(this.webServices)) {
|
for (const key of Object.keys(this.webServices)) {
|
||||||
const service = this.webServices[key];
|
const service = (this.webServices as any)[key];
|
||||||
if(service.deinit) {
|
if (service.deinit) {
|
||||||
service.deinit();
|
service.deinit();
|
||||||
}
|
}
|
||||||
service.application = null;
|
service.application = undefined;
|
||||||
delete this.webServices[key];
|
|
||||||
}
|
}
|
||||||
this.webServices = {};
|
this.webServices = {} as WebServices;
|
||||||
this.onDeinit(this);
|
this.onDeinit!(this);
|
||||||
this.onDeinit = null;
|
this.onDeinit = undefined;
|
||||||
this.$compile = null;
|
this.$compile = undefined;
|
||||||
this.$timeout = null;
|
(this.scope! as any).application = undefined;
|
||||||
this.scope.application = null;
|
this.scope!.$destroy();
|
||||||
this.scope.$destroy();
|
this.scope = undefined;
|
||||||
this.scope = null;
|
|
||||||
super.deinit();
|
super.deinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setWebServices(services: WebServices) {
|
||||||
/**
|
|
||||||
* @access public
|
|
||||||
* @param {object} services
|
|
||||||
*/
|
|
||||||
setWebServices(services) {
|
|
||||||
this.webServices = services;
|
this.webServices = services;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,20 +134,20 @@ export class WebApplication extends SNApplication {
|
|||||||
return this.protocolUpgradeAvailable();
|
return this.protocolUpgradeAvailable();
|
||||||
}
|
}
|
||||||
|
|
||||||
presentPasswordWizard(type) {
|
presentPasswordWizard(type: PasswordWizardType) {
|
||||||
const scope = this.scope.$new(true);
|
const scope: any = this.scope!.$new(true);
|
||||||
scope.type = type;
|
scope.type = type;
|
||||||
scope.application = this;
|
scope.application = this;
|
||||||
const el = this.$compile("<password-wizard application='application' type='type'></password-wizard>")(scope);
|
const el = this.$compile!("<password-wizard application='application' type='type'></password-wizard>")(scope);
|
||||||
angular.element(document.body).append(el);
|
angular.element(document.body).append(el);
|
||||||
}
|
}
|
||||||
|
|
||||||
promptForChallenge(challenge, orchestrator) {
|
promptForChallenge(challenge: Challenge, orchestrator: ChallengeOrchestrator) {
|
||||||
const scope = this.scope.$new(true);
|
const scope: any = this.scope!.$new(true);
|
||||||
scope.challenge = challenge;
|
scope.challenge = challenge;
|
||||||
scope.orchestrator = orchestrator;
|
scope.orchestrator = orchestrator;
|
||||||
scope.application = this;
|
scope.application = this;
|
||||||
const el = this.$compile(
|
const el = this.$compile!(
|
||||||
"<challenge-modal " +
|
"<challenge-modal " +
|
||||||
"class='sk-modal' application='application' challenge='challenge' orchestrator='orchestrator'>" +
|
"class='sk-modal' application='application' challenge='challenge' orchestrator='orchestrator'>" +
|
||||||
"</challenge-modal>"
|
"</challenge-modal>"
|
||||||
@@ -133,19 +157,23 @@ export class WebApplication extends SNApplication {
|
|||||||
|
|
||||||
async performProtocolUpgrade() {
|
async performProtocolUpgrade() {
|
||||||
const errors = await this.upgradeProtocolVersion();
|
const errors = await this.upgradeProtocolVersion();
|
||||||
if (errors.length === 0) {
|
if (!errors || errors.length === 0) {
|
||||||
this.alertService.alert({
|
this.alertService!.alert(
|
||||||
text: "Success! Your encryption version has been upgraded." +
|
"Success! Your encryption version has been upgraded." +
|
||||||
" You'll be asked to enter your credentials again on other devices you're signed into."
|
" You'll be asked to enter your credentials again on other devices you're signed into."
|
||||||
});
|
);
|
||||||
} else {
|
} else {
|
||||||
this.alertService.alert({
|
this.alertService!.alert(
|
||||||
text: "Unable to upgrade encryption version. Please try again."
|
"Unable to upgrade encryption version. Please try again."
|
||||||
});
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async presentPrivilegesModal(action, onSuccess, onCancel) {
|
async presentPrivilegesModal(
|
||||||
|
action: ProtectedAction,
|
||||||
|
onSuccess: any,
|
||||||
|
onCancel: any
|
||||||
|
) {
|
||||||
if (this.authenticationInProgress()) {
|
if (this.authenticationInProgress()) {
|
||||||
onCancel && onCancel();
|
onCancel && onCancel();
|
||||||
return;
|
return;
|
||||||
@@ -153,19 +181,19 @@ export class WebApplication extends SNApplication {
|
|||||||
|
|
||||||
const customSuccess = async () => {
|
const customSuccess = async () => {
|
||||||
onSuccess && await onSuccess();
|
onSuccess && await onSuccess();
|
||||||
this.currentAuthenticationElement = null;
|
this.currentAuthenticationElement = undefined;
|
||||||
};
|
};
|
||||||
const customCancel = async () => {
|
const customCancel = async () => {
|
||||||
onCancel && await onCancel();
|
onCancel && await onCancel();
|
||||||
this.currentAuthenticationElement = null;
|
this.currentAuthenticationElement = undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
const scope = this.scope.$new(true);
|
const scope: any = this.scope!.$new(true);
|
||||||
scope.action = action;
|
scope.action = action;
|
||||||
scope.onSuccess = customSuccess;
|
scope.onSuccess = customSuccess;
|
||||||
scope.onCancel = customCancel;
|
scope.onCancel = customCancel;
|
||||||
scope.application = this;
|
scope.application = this;
|
||||||
const el = this.$compile(`
|
const el = this.$compile!(`
|
||||||
<privileges-auth-modal application='application' action='action' on-success='onSuccess'
|
<privileges-auth-modal application='application' action='action' on-success='onSuccess'
|
||||||
on-cancel='onCancel' class='sk-modal'></privileges-auth-modal>
|
on-cancel='onCancel' class='sk-modal'></privileges-auth-modal>
|
||||||
`)(scope);
|
`)(scope);
|
||||||
@@ -175,9 +203,9 @@ export class WebApplication extends SNApplication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
presentPrivilegesManagementModal() {
|
presentPrivilegesManagementModal() {
|
||||||
const scope = this.scope.$new(true);
|
const scope: any = this.scope!.$new(true);
|
||||||
scope.application = this;
|
scope.application = this;
|
||||||
const el = this.$compile("<privileges-management-modal application='application' class='sk-modal'></privileges-management-modal>")(scope);
|
const el = this.$compile!("<privileges-management-modal application='application' class='sk-modal'></privileges-management-modal>")(scope);
|
||||||
angular.element(document.body).append(el);
|
angular.element(document.body).append(el);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -185,26 +213,26 @@ export class WebApplication extends SNApplication {
|
|||||||
return this.currentAuthenticationElement != null;
|
return this.currentAuthenticationElement != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
presentPasswordModal(callback) {
|
presentPasswordModal(callback: () => void) {
|
||||||
const scope = this.scope.$new(true);
|
const scope: any = this.scope!.$new(true);
|
||||||
scope.type = "password";
|
scope.type = "password";
|
||||||
scope.title = "Decryption Assistance";
|
scope.title = "Decryption Assistance";
|
||||||
scope.message = `Unable to decrypt this item with your current keys.
|
scope.message = `Unable to decrypt this item with your current keys.
|
||||||
Please enter your account password at the time of this revision.`;
|
Please enter your account password at the time of this revision.`;
|
||||||
scope.callback = callback;
|
scope.callback = callback;
|
||||||
const el = this.$compile(
|
const el = this.$compile!(
|
||||||
`<input-modal type='type' message='message'
|
`<input-modal type='type' message='message'
|
||||||
title='title' callback='callback'></input-modal>`
|
title='title' callback='callback'></input-modal>`
|
||||||
)(scope);
|
)(scope);
|
||||||
angular.element(document.body).append(el);
|
angular.element(document.body).append(el);
|
||||||
}
|
}
|
||||||
|
|
||||||
presentRevisionPreviewModal(uuid, content) {
|
presentRevisionPreviewModal(uuid: string, content: any) {
|
||||||
const scope = this.scope.$new(true);
|
const scope: any = this.scope!.$new(true);
|
||||||
scope.uuid = uuid;
|
scope.uuid = uuid;
|
||||||
scope.content = content;
|
scope.content = content;
|
||||||
scope.application = this;
|
scope.application = this;
|
||||||
const el = this.$compile(
|
const el = this.$compile!(
|
||||||
`<revision-preview-modal application='application' uuid='uuid' content='content'
|
`<revision-preview-modal application='application' uuid='uuid' content='content'
|
||||||
class='sk-modal'></revision-preview-modal>`
|
class='sk-modal'></revision-preview-modal>`
|
||||||
)(scope);
|
)(scope);
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ApplicationEvents } from 'snjs';
|
import { ApplicationEvent } from 'snjs';
|
||||||
|
|
||||||
export class PureCtrl {
|
export class PureCtrl {
|
||||||
/* @ngInject */
|
/* @ngInject */
|
||||||
@@ -84,13 +84,13 @@ export class PureCtrl {
|
|||||||
}
|
}
|
||||||
this.unsubApp = this.application.addEventObserver(async (eventName) => {
|
this.unsubApp = this.application.addEventObserver(async (eventName) => {
|
||||||
this.onAppEvent(eventName);
|
this.onAppEvent(eventName);
|
||||||
if (eventName === ApplicationEvents.Started) {
|
if (eventName === ApplicationEvent.Started) {
|
||||||
await this.onAppStart();
|
await this.onAppStart();
|
||||||
} else if (eventName === ApplicationEvents.Launched) {
|
} else if (eventName === ApplicationEvent.Launched) {
|
||||||
await this.onAppLaunch();
|
await this.onAppLaunch();
|
||||||
} else if (eventName === ApplicationEvents.CompletedSync) {
|
} else if (eventName === ApplicationEvent.CompletedSync) {
|
||||||
this.onAppSync();
|
this.onAppSync();
|
||||||
} else if (eventName === ApplicationEvents.KeyStatusChanged) {
|
} else if (eventName === ApplicationEvent.KeyStatusChanged) {
|
||||||
this.onAppKeyChange();
|
this.onAppKeyChange();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { getPlatformString } from '@/utils';
|
import { getPlatformString } from '@/utils';
|
||||||
import template from '%/application-view.pug';
|
import template from '%/application-view.pug';
|
||||||
import { AppStateEvents } from '@/services/state';
|
import { AppStateEvents } from '@/services/state';
|
||||||
import { ApplicationEvents } from 'snjs';
|
import { ApplicationEvent } from 'snjs';
|
||||||
import angular from 'angular';
|
import angular from 'angular';
|
||||||
import {
|
import {
|
||||||
PANEL_NAME_NOTES,
|
PANEL_NAME_NOTES,
|
||||||
@@ -91,34 +91,34 @@ class ApplicationViewCtrl extends PureCtrl {
|
|||||||
/** @override */
|
/** @override */
|
||||||
async onAppEvent(eventName) {
|
async onAppEvent(eventName) {
|
||||||
super.onAppEvent(eventName);
|
super.onAppEvent(eventName);
|
||||||
if (eventName === ApplicationEvents.LocalDataIncrementalLoad) {
|
if (eventName === ApplicationEvent.LocalDataIncrementalLoad) {
|
||||||
this.updateLocalDataStatus();
|
this.updateLocalDataStatus();
|
||||||
} else if (
|
} else if (
|
||||||
eventName === ApplicationEvents.SyncStatusChanged ||
|
eventName === ApplicationEvent.SyncStatusChanged ||
|
||||||
eventName === ApplicationEvents.FailedSync
|
eventName === ApplicationEvent.FailedSync
|
||||||
) {
|
) {
|
||||||
this.updateSyncStatus();
|
this.updateSyncStatus();
|
||||||
} else if (eventName === ApplicationEvents.LocalDataLoaded) {
|
} else if (eventName === ApplicationEvent.LocalDataLoaded) {
|
||||||
this.updateLocalDataStatus();
|
this.updateLocalDataStatus();
|
||||||
} else if (eventName === ApplicationEvents.WillSync) {
|
} else if (eventName === ApplicationEvent.WillSync) {
|
||||||
if (!this.completedInitialSync) {
|
if (!this.completedInitialSync) {
|
||||||
this.syncStatus = this.application.getStatusService().replaceStatusWithString(
|
this.syncStatus = this.application.getStatusService().replaceStatusWithString(
|
||||||
this.syncStatus,
|
this.syncStatus,
|
||||||
"Syncing..."
|
"Syncing..."
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else if (eventName === ApplicationEvents.CompletedSync) {
|
} else if (eventName === ApplicationEvent.CompletedSync) {
|
||||||
if (!this.completedInitialSync) {
|
if (!this.completedInitialSync) {
|
||||||
this.syncStatus = this.application.getStatusService().removeStatus(this.syncStatus);
|
this.syncStatus = this.application.getStatusService().removeStatus(this.syncStatus);
|
||||||
this.completedInitialSync = true;
|
this.completedInitialSync = true;
|
||||||
}
|
}
|
||||||
} else if (eventName === ApplicationEvents.InvalidSyncSession) {
|
} else if (eventName === ApplicationEvent.InvalidSyncSession) {
|
||||||
this.showInvalidSessionAlert();
|
this.showInvalidSessionAlert();
|
||||||
} else if (eventName === ApplicationEvents.LocalDatabaseReadError) {
|
} else if (eventName === ApplicationEvent.LocalDatabaseReadError) {
|
||||||
this.application.alertService.alert({
|
this.application.alertService.alert({
|
||||||
text: 'Unable to load local database. Please restart the app and try again.'
|
text: 'Unable to load local database. Please restart the app and try again.'
|
||||||
});
|
});
|
||||||
} else if (eventName === ApplicationEvents.LocalDatabaseWriteError) {
|
} else if (eventName === ApplicationEvent.LocalDatabaseWriteError) {
|
||||||
this.application.alertService.alert({
|
this.application.alertService.alert({
|
||||||
text: 'Unable to write to local database. Please restart the app and try again.'
|
text: 'Unable to write to local database. Please restart the app and try again.'
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import angular from 'angular';
|
import angular from 'angular';
|
||||||
import {
|
import {
|
||||||
ApplicationEvents,
|
ApplicationEvent,
|
||||||
isPayloadSourceRetrieved,
|
isPayloadSourceRetrieved,
|
||||||
ContentTypes,
|
ContentTypes,
|
||||||
ProtectedActions
|
ProtectedActions
|
||||||
@@ -113,9 +113,9 @@ class EditorCtrl extends PureCtrl {
|
|||||||
if (!this.state.note) {
|
if (!this.state.note) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (eventName === ApplicationEvents.HighLatencySync) {
|
if (eventName === ApplicationEvent.HighLatencySync) {
|
||||||
this.setState({ syncTakingTooLong: true });
|
this.setState({ syncTakingTooLong: true });
|
||||||
} else if (eventName === ApplicationEvents.CompletedSync) {
|
} else if (eventName === ApplicationEvent.CompletedSync) {
|
||||||
this.setState({ syncTakingTooLong: false });
|
this.setState({ syncTakingTooLong: false });
|
||||||
if (this.state.note.dirty) {
|
if (this.state.note.dirty) {
|
||||||
/** if we're still dirty, don't change status, a sync is likely upcoming. */
|
/** if we're still dirty, don't change status, a sync is likely upcoming. */
|
||||||
@@ -126,7 +126,7 @@ class EditorCtrl extends PureCtrl {
|
|||||||
this.showAllChangesSavedStatus();
|
this.showAllChangesSavedStatus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (eventName === ApplicationEvents.FailedSync) {
|
} else if (eventName === ApplicationEvent.FailedSync) {
|
||||||
/**
|
/**
|
||||||
* Only show error status in editor if the note is dirty.
|
* Only show error status in editor if the note is dirty.
|
||||||
* Otherwise, it means the originating sync came from somewhere else
|
* Otherwise, it means the originating sync came from somewhere else
|
||||||
@@ -135,7 +135,7 @@ class EditorCtrl extends PureCtrl {
|
|||||||
if (this.state.note.dirty) {
|
if (this.state.note.dirty) {
|
||||||
this.showErrorStatus();
|
this.showErrorStatus();
|
||||||
}
|
}
|
||||||
} else if (eventName === ApplicationEvents.LocalDatabaseWriteError) {
|
} else if (eventName === ApplicationEvent.LocalDatabaseWriteError) {
|
||||||
this.showErrorStatus({
|
this.showErrorStatus({
|
||||||
message: "Offline Saving Issue",
|
message: "Offline Saving Issue",
|
||||||
desc: "Changes not saved"
|
desc: "Changes not saved"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { dateToLocalizedString } from '@/utils';
|
import { dateToLocalizedString } from '@/utils';
|
||||||
import {
|
import {
|
||||||
ApplicationEvents,
|
ApplicationEvent,
|
||||||
TIMING_STRATEGY_FORCE_SPAWN_NEW,
|
TIMING_STRATEGY_FORCE_SPAWN_NEW,
|
||||||
ProtectedActions,
|
ProtectedActions,
|
||||||
ContentTypes
|
ContentTypes
|
||||||
@@ -132,24 +132,24 @@ class FooterCtrl extends PureCtrl {
|
|||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
onAppEvent(eventName) {
|
onAppEvent(eventName) {
|
||||||
if (eventName === ApplicationEvents.KeyStatusChanged) {
|
if (eventName === ApplicationEvent.KeyStatusChanged) {
|
||||||
this.reloadUpgradeStatus();
|
this.reloadUpgradeStatus();
|
||||||
} else if (eventName === ApplicationEvents.EnteredOutOfSync) {
|
} else if (eventName === ApplicationEvent.EnteredOutOfSync) {
|
||||||
this.setState({
|
this.setState({
|
||||||
outOfSync: true
|
outOfSync: true
|
||||||
});
|
});
|
||||||
} else if (eventName === ApplicationEvents.ExitedOutOfSync) {
|
} else if (eventName === ApplicationEvent.ExitedOutOfSync) {
|
||||||
this.setState({
|
this.setState({
|
||||||
outOfSync: false
|
outOfSync: false
|
||||||
});
|
});
|
||||||
} else if (eventName === ApplicationEvents.CompletedSync) {
|
} else if (eventName === ApplicationEvent.CompletedSync) {
|
||||||
if (this.offline && this.application.getNoteCount() === 0) {
|
if (this.offline && this.application.getNoteCount() === 0) {
|
||||||
this.showAccountMenu = true;
|
this.showAccountMenu = true;
|
||||||
}
|
}
|
||||||
this.syncUpdated();
|
this.syncUpdated();
|
||||||
this.findErrors();
|
this.findErrors();
|
||||||
this.updateOfflineStatus();
|
this.updateOfflineStatus();
|
||||||
} else if (eventName === ApplicationEvents.FailedSync) {
|
} else if (eventName === ApplicationEvent.FailedSync) {
|
||||||
this.findErrors();
|
this.findErrors();
|
||||||
this.updateOfflineStatus();
|
this.updateOfflineStatus();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import angular from 'angular';
|
import angular from 'angular';
|
||||||
import template from '%/notes.pug';
|
import template from '%/notes.pug';
|
||||||
import { ApplicationEvents, ContentTypes, removeFromArray } from 'snjs';
|
import { ApplicationEvent, ContentTypes, removeFromArray } from 'snjs';
|
||||||
import { PureCtrl } from '@Controllers';
|
import { PureCtrl } from '@Controllers';
|
||||||
import { AppStateEvents } from '@/services/state';
|
import { AppStateEvents } from '@/services/state';
|
||||||
import { KeyboardModifiers, KeyboardKeys } from '@/services/keyboardManager';
|
import { KeyboardModifiers, KeyboardKeys } from '@/services/keyboardManager';
|
||||||
@@ -103,14 +103,14 @@ class NotesCtrl extends PureCtrl {
|
|||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
async onAppEvent(eventName) {
|
async onAppEvent(eventName) {
|
||||||
if (eventName === ApplicationEvents.SignedIn) {
|
if (eventName === ApplicationEvent.SignedIn) {
|
||||||
/** Delete dummy note if applicable */
|
/** Delete dummy note if applicable */
|
||||||
if (this.state.selectedNote && this.state.selectedNote.dummy) {
|
if (this.state.selectedNote && this.state.selectedNote.dummy) {
|
||||||
this.application.deleteItemLocally({ item: this.state.selectedNote });
|
this.application.deleteItemLocally({ item: this.state.selectedNote });
|
||||||
await this.selectNote(null);
|
await this.selectNote(null);
|
||||||
await this.reloadNotes();
|
await this.reloadNotes();
|
||||||
}
|
}
|
||||||
} else if (eventName === ApplicationEvents.CompletedSync) {
|
} else if (eventName === ApplicationEvent.CompletedSync) {
|
||||||
this.getMostValidNotes().then((notes) => {
|
this.getMostValidNotes().then((notes) => {
|
||||||
if (notes.length === 0) {
|
if (notes.length === 0) {
|
||||||
this.createPlaceholderNote();
|
this.createPlaceholderNote();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {
|
|||||||
SNNote,
|
SNNote,
|
||||||
SNSmartTag,
|
SNSmartTag,
|
||||||
ContentTypes,
|
ContentTypes,
|
||||||
ApplicationEvents,
|
ApplicationEvent,
|
||||||
ComponentActions
|
ComponentActions
|
||||||
} from 'snjs';
|
} from 'snjs';
|
||||||
import template from '%/tags.pug';
|
import template from '%/tags.pug';
|
||||||
@@ -107,9 +107,9 @@ class TagsPanelCtrl extends PureCtrl {
|
|||||||
/** @override */
|
/** @override */
|
||||||
async onAppEvent(eventName) {
|
async onAppEvent(eventName) {
|
||||||
super.onAppEvent(eventName);
|
super.onAppEvent(eventName);
|
||||||
if (eventName === ApplicationEvents.LocalDataIncrementalLoad) {
|
if (eventName === ApplicationEvent.LocalDataIncrementalLoad) {
|
||||||
this.reloadNoteCounts();
|
this.reloadNoteCounts();
|
||||||
} else if (eventName === ApplicationEvents.SyncStatusChanged) {
|
} else if (eventName === ApplicationEvent.SyncStatusChanged) {
|
||||||
const syncStatus = this.application.getSyncStatus();
|
const syncStatus = this.application.getSyncStatus();
|
||||||
const stats = syncStatus.getStats();
|
const stats = syncStatus.getStats();
|
||||||
if (stats.downloadCount > 0) {
|
if (stats.downloadCount > 0) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { isDesktopApplication } from './utils';
|
import { isDesktopApplication } from './utils';
|
||||||
|
|
||||||
/* @ngInject */
|
/* @ngInject */
|
||||||
export function configRoutes($locationProvider) {
|
export function configRoutes($locationProvider: ng.ILocationProvider) {
|
||||||
if (!isDesktopApplication()) {
|
if (!isDesktopApplication()) {
|
||||||
if (window.history && window.history.pushState) {
|
if (window.history && window.history.pushState) {
|
||||||
$locationProvider.html5Mode({
|
$locationProvider.html5Mode({
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
/* eslint-disable camelcase */
|
/* eslint-disable camelcase */
|
||||||
// An interface used by the Desktop app to interact with SN
|
// An interface used by the Desktop app to interact with SN
|
||||||
import { isDesktopApplication } from '@/utils';
|
import { isDesktopApplication } from '@/utils';
|
||||||
import { EncryptionIntents, ApplicationService, ApplicationEvents, removeFromArray } from 'snjs';
|
import { EncryptionIntents, ApplicationService, ApplicationEvent, removeFromArray } from 'snjs';
|
||||||
|
|
||||||
const COMPONENT_DATA_KEY_INSTALL_ERROR = 'installError';
|
const COMPONENT_DATA_KEY_INSTALL_ERROR = 'installError';
|
||||||
const COMPONENT_CONTENT_KEY_PACKAGE_INFO = 'package_info';
|
const COMPONENT_CONTENT_KEY_PACKAGE_INFO = 'package_info';
|
||||||
@@ -30,12 +30,12 @@ export class DesktopManager extends ApplicationService {
|
|||||||
/** @override */
|
/** @override */
|
||||||
onAppEvent(eventName) {
|
onAppEvent(eventName) {
|
||||||
super.onAppEvent(eventName);
|
super.onAppEvent(eventName);
|
||||||
if (eventName === ApplicationEvents.LocalDataLoaded) {
|
if (eventName === ApplicationEvent.LocalDataLoaded) {
|
||||||
this.dataLoaded = true;
|
this.dataLoaded = true;
|
||||||
if (this.dataLoadHandler) {
|
if (this.dataLoadHandler) {
|
||||||
this.dataLoadHandler();
|
this.dataLoadHandler();
|
||||||
}
|
}
|
||||||
} else if (eventName === ApplicationEvents.MajorDataChange) {
|
} else if (eventName === ApplicationEvent.MajorDataChange) {
|
||||||
if (this.majorDataChangeHandler) {
|
if (this.majorDataChangeHandler) {
|
||||||
this.majorDataChangeHandler();
|
this.majorDataChangeHandler();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { isDesktopApplication } from '@/utils';
|
import { isDesktopApplication } from '@/utils';
|
||||||
import pull from 'lodash/pull';
|
import pull from 'lodash/pull';
|
||||||
import { ProtectedActions, ApplicationEvents } from 'snjs';
|
import { ProtectedActions, ApplicationEvent } from 'snjs';
|
||||||
|
|
||||||
export const AppStateEvents = {
|
export const AppStateEvents = {
|
||||||
TagChanged: 1,
|
TagChanged: 1,
|
||||||
@@ -52,9 +52,9 @@ export class AppState {
|
|||||||
|
|
||||||
addAppEventObserver() {
|
addAppEventObserver() {
|
||||||
this.unsubApp = this.application.addEventObserver(async (eventName) => {
|
this.unsubApp = this.application.addEventObserver(async (eventName) => {
|
||||||
if (eventName === ApplicationEvents.Started) {
|
if (eventName === ApplicationEvent.Started) {
|
||||||
this.locked = true;
|
this.locked = true;
|
||||||
} else if (eventName === ApplicationEvents.Launched) {
|
} else if (eventName === ApplicationEvent.Launched) {
|
||||||
this.locked = false;
|
this.locked = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import {
|
import {
|
||||||
ApplicationEvents,
|
ApplicationEvent,
|
||||||
StorageValueModes,
|
StorageValueModes,
|
||||||
EncryptionIntents,
|
EncryptionIntents,
|
||||||
ApplicationService,
|
ApplicationService,
|
||||||
|
|||||||
26
app/assets/javascripts/tsconfig.json
Normal file
26
app/assets/javascripts/tsconfig.json
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "esnext",
|
||||||
|
"module": "commonjs",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"allowJs": true,
|
||||||
|
"strict": true,
|
||||||
|
"isolatedModules": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"types": ["node", "../../../node_modules/snjs/dist/@types"],
|
||||||
|
"declaration": true,
|
||||||
|
"declarationDir": "@types",
|
||||||
|
"emitDeclarationOnly": true,
|
||||||
|
"baseUrl": ".",
|
||||||
|
"paths": {
|
||||||
|
"%/*": ["../templates/*"],
|
||||||
|
"@/*": ["./*"],
|
||||||
|
"@Controllers/*": ["./controllers/*"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"typeAcquisition": {
|
||||||
|
"include": [
|
||||||
|
"snjs"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
4
app/assets/javascripts/types.ts
Normal file
4
app/assets/javascripts/types.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export enum PasswordWizardType {
|
||||||
|
ChangePassword = 1,
|
||||||
|
AccountUpgrade = 2
|
||||||
|
}
|
||||||
@@ -61,10 +61,9 @@ export function getPlatformString() {
|
|||||||
if (platform.indexOf('linux') !== -1) {
|
if (platform.indexOf('linux') !== -1) {
|
||||||
trimmed = 'linux';
|
trimmed = 'linux';
|
||||||
}
|
}
|
||||||
|
|
||||||
return trimmed + (isDesktopApplication() ? '-desktop' : '-web');
|
return trimmed + (isDesktopApplication() ? '-desktop' : '-web');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return null;
|
return 'unknown-platform';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,41 +1,31 @@
|
|||||||
import { DeviceInterface, getGlobalScope } from 'snjs';
|
import { DeviceInterface, getGlobalScope, SNApplication } from 'snjs';
|
||||||
import { Database } from '@/database';
|
import { Database } from '@/database';
|
||||||
|
|
||||||
const KEYCHAIN_STORAGE_KEY = 'keychain';
|
const KEYCHAIN_STORAGE_KEY = 'keychain';
|
||||||
|
|
||||||
export class WebDeviceInterface extends DeviceInterface {
|
export class WebDeviceInterface extends DeviceInterface {
|
||||||
|
|
||||||
constructor({
|
private database: Database
|
||||||
namespace,
|
|
||||||
timeout
|
|
||||||
} = {}) {
|
|
||||||
super({
|
|
||||||
namespace,
|
|
||||||
timeout: timeout || setTimeout.bind(getGlobalScope()),
|
|
||||||
interval: setInterval.bind(getGlobalScope())
|
|
||||||
});
|
|
||||||
this.createDatabase();
|
|
||||||
}
|
|
||||||
|
|
||||||
createDatabase() {
|
constructor(namespace: string, timeout: any) {
|
||||||
|
super(
|
||||||
|
namespace,
|
||||||
|
timeout || setTimeout.bind(getGlobalScope()),
|
||||||
|
setInterval.bind(getGlobalScope())
|
||||||
|
);
|
||||||
this.database = new Database();
|
this.database = new Database();
|
||||||
}
|
}
|
||||||
|
|
||||||
setApplication(application) {
|
setApplication(application: SNApplication) {
|
||||||
this.database.setApplication(application);
|
this.database.setApplication(application);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @override */
|
|
||||||
deinit() {
|
deinit() {
|
||||||
super.deinit();
|
super.deinit();
|
||||||
this.database.deinit();
|
this.database.deinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
async getRawStorageValue(key: string) {
|
||||||
* @value storage
|
|
||||||
*/
|
|
||||||
|
|
||||||
async getRawStorageValue(key) {
|
|
||||||
return localStorage.getItem(key);
|
return localStorage.getItem(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,11 +40,11 @@ export class WebDeviceInterface extends DeviceInterface {
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
async setRawStorageValue(key, value) {
|
async setRawStorageValue(key: string, value: any) {
|
||||||
localStorage.setItem(key, value);
|
localStorage.setItem(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
async removeRawStorageValue(key) {
|
async removeRawStorageValue(key: string) {
|
||||||
localStorage.removeItem(key);
|
localStorage.removeItem(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,11 +62,10 @@ export class WebDeviceInterface extends DeviceInterface {
|
|||||||
}).catch((error => {
|
}).catch((error => {
|
||||||
reject(error);
|
reject(error);
|
||||||
}));
|
}));
|
||||||
});
|
}) as Promise<{ isNewDatabase?: boolean } | undefined>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @private */
|
private getDatabaseKeyPrefix() {
|
||||||
getDatabaseKeyPrefix() {
|
|
||||||
if (this.namespace) {
|
if (this.namespace) {
|
||||||
return `${this.namespace}-item-`;
|
return `${this.namespace}-item-`;
|
||||||
} else {
|
} else {
|
||||||
@@ -84,8 +73,7 @@ export class WebDeviceInterface extends DeviceInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @private */
|
private keyForPayloadId(id: string) {
|
||||||
keyForPayloadId(id) {
|
|
||||||
return `${this.getDatabaseKeyPrefix()}${id}`;
|
return `${this.getDatabaseKeyPrefix()}${id}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,15 +81,15 @@ export class WebDeviceInterface extends DeviceInterface {
|
|||||||
return this.database.getAllPayloads();
|
return this.database.getAllPayloads();
|
||||||
}
|
}
|
||||||
|
|
||||||
async saveRawDatabasePayload(payload) {
|
async saveRawDatabasePayload(payload: any) {
|
||||||
return this.database.savePayload(payload);
|
return this.database.savePayload(payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
async saveRawDatabasePayloads(payloads) {
|
async saveRawDatabasePayloads(payloads: any[]) {
|
||||||
return this.database.savePayloads(payloads);
|
return this.database.savePayloads(payloads);
|
||||||
}
|
}
|
||||||
|
|
||||||
async removeRawDatabasePayloadWithId(id) {
|
async removeRawDatabasePayloadWithId(id: string) {
|
||||||
return this.database.deletePayload(id);
|
return this.database.deletePayload(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +97,6 @@ export class WebDeviceInterface extends DeviceInterface {
|
|||||||
return this.database.clearAllPayloads();
|
return this.database.clearAllPayloads();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @keychian */
|
|
||||||
async getKeychainValue() {
|
async getKeychainValue() {
|
||||||
const value = localStorage.getItem(KEYCHAIN_STORAGE_KEY);
|
const value = localStorage.getItem(KEYCHAIN_STORAGE_KEY);
|
||||||
if (value) {
|
if (value) {
|
||||||
@@ -117,7 +104,7 @@ export class WebDeviceInterface extends DeviceInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async setKeychainValue(value) {
|
async setKeychainValue(value: any) {
|
||||||
localStorage.setItem(KEYCHAIN_STORAGE_KEY, JSON.stringify(value));
|
localStorage.setItem(KEYCHAIN_STORAGE_KEY, JSON.stringify(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,14 +112,10 @@ export class WebDeviceInterface extends DeviceInterface {
|
|||||||
localStorage.removeItem(KEYCHAIN_STORAGE_KEY);
|
localStorage.removeItem(KEYCHAIN_STORAGE_KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
openUrl(url: string) {
|
||||||
* @actions
|
|
||||||
*/
|
|
||||||
openUrl(url) {
|
|
||||||
const win = window.open(url, '_blank');
|
const win = window.open(url, '_blank');
|
||||||
if (win) {
|
if (win) {
|
||||||
win.focus();
|
win.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
90632
dist/javascripts/app.js
vendored
90632
dist/javascripts/app.js
vendored
File diff suppressed because one or more lines are too long
2
dist/javascripts/app.js.map
vendored
2
dist/javascripts/app.js.map
vendored
File diff suppressed because one or more lines are too long
2657
dist/stylesheets/app.css
vendored
2657
dist/stylesheets/app.css
vendored
File diff suppressed because one or more lines are too long
2
dist/stylesheets/app.css.map
vendored
2
dist/stylesheets/app.css.map
vendored
File diff suppressed because one or more lines are too long
252
package-lock.json
generated
252
package-lock.json
generated
@@ -1026,6 +1026,15 @@
|
|||||||
"@babel/helper-plugin-utils": "^7.8.3"
|
"@babel/helper-plugin-utils": "^7.8.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@babel/plugin-syntax-typescript": {
|
||||||
|
"version": "7.8.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.8.3.tgz",
|
||||||
|
"integrity": "sha512-GO1MQ/SGGGoiEXY0e0bSpHimJvxqB7lktLLIq2pv8xG7WZ8IMEle74jIe1FhprHBWjwjZtXHkycDLZXIWM5Wfg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@babel/helper-plugin-utils": "^7.8.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@babel/plugin-transform-arrow-functions": {
|
"@babel/plugin-transform-arrow-functions": {
|
||||||
"version": "7.8.3",
|
"version": "7.8.3",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.8.3.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.8.3.tgz",
|
||||||
@@ -1335,6 +1344,17 @@
|
|||||||
"@babel/helper-plugin-utils": "^7.8.3"
|
"@babel/helper-plugin-utils": "^7.8.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@babel/plugin-transform-typescript": {
|
||||||
|
"version": "7.9.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.9.4.tgz",
|
||||||
|
"integrity": "sha512-yeWeUkKx2auDbSxRe8MusAG+n4m9BFY/v+lPjmQDgOFX5qnySkUY5oXzkp6FwPdsYqnKay6lorXYdC0n3bZO7w==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@babel/helper-create-class-features-plugin": "^7.8.3",
|
||||||
|
"@babel/helper-plugin-utils": "^7.8.3",
|
||||||
|
"@babel/plugin-syntax-typescript": "^7.8.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@babel/plugin-transform-unicode-regex": {
|
"@babel/plugin-transform-unicode-regex": {
|
||||||
"version": "7.8.3",
|
"version": "7.8.3",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.8.3.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.8.3.tgz",
|
||||||
@@ -1423,6 +1443,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@babel/preset-typescript": {
|
||||||
|
"version": "7.9.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.9.0.tgz",
|
||||||
|
"integrity": "sha512-S4cueFnGrIbvYJgwsVFKdvOmpiL0XGw9MFW9D0vgRys5g36PBhZRL8NX8Gr2akz8XRtzq6HuDXPD/1nniagNUg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@babel/helper-plugin-utils": "^7.8.3",
|
||||||
|
"@babel/plugin-transform-typescript": "^7.9.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@babel/runtime": {
|
"@babel/runtime": {
|
||||||
"version": "7.8.7",
|
"version": "7.8.7",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.8.7.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.8.7.tgz",
|
||||||
@@ -1560,6 +1590,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@types/angular": {
|
||||||
|
"version": "1.7.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/angular/-/angular-1.7.0.tgz",
|
||||||
|
"integrity": "sha512-zneUmi5I6oSkGBqkRP9rxbWX1mi6Yj7gNV+WNffmJLf8x4cnV0MGqXFNSP90NZ1kRRLCOdKBf9RIVD1TMg4aog==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"@types/babel-types": {
|
"@types/babel-types": {
|
||||||
"version": "7.0.7",
|
"version": "7.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/@types/babel-types/-/babel-types-7.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/@types/babel-types/-/babel-types-7.0.7.tgz",
|
||||||
@@ -1575,6 +1611,18 @@
|
|||||||
"@types/babel-types": "*"
|
"@types/babel-types": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@types/chai": {
|
||||||
|
"version": "4.2.11",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.11.tgz",
|
||||||
|
"integrity": "sha512-t7uW6eFafjO+qJ3BIV2gGUyZs27egcNRkUdalkud+Qa3+kg//f129iuOFivHDXQ+vnU3fDXuwgv0cqMCbcE8sw==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"@types/eslint-visitor-keys": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"@types/events": {
|
"@types/events": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz",
|
||||||
@@ -1592,18 +1640,129 @@
|
|||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@types/json-schema": {
|
||||||
|
"version": "7.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.4.tgz",
|
||||||
|
"integrity": "sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"@types/lodash": {
|
||||||
|
"version": "4.14.149",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.149.tgz",
|
||||||
|
"integrity": "sha512-ijGqzZt/b7BfzcK9vTrS6MFljQRPn5BFWOx8oE0GYxribu6uV+aA9zZuXI1zc/etK9E8nrgdoF2+LgUw7+9tJQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"@types/minimatch": {
|
"@types/minimatch": {
|
||||||
"version": "3.0.3",
|
"version": "3.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
|
||||||
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==",
|
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/mocha": {
|
||||||
"version": "13.9.0",
|
"version": "7.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-13.9.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-7.0.2.tgz",
|
||||||
"integrity": "sha512-0ARSQootUG1RljH2HncpsY2TJBfGQIKOOi7kxzUY6z54ePu/ZD+wJA8zI2Q6v8rol2qpG/rvqsReco8zNMPvhQ==",
|
"integrity": "sha512-ZvO2tAcjmMi8V/5Z3JsyofMe3hasRcaw88cto5etSVMwVQfeivGAlEYmaQgceUSVYFofVjT+ioHsATjdWcFt1w==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"@types/node": {
|
||||||
|
"version": "12.12.35",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.35.tgz",
|
||||||
|
"integrity": "sha512-ASYsaKecA7TUsDrqIGPNk3JeEox0z/0XR/WsJJ8BIX/9+SkMSImQXKWfU/yBrSyc7ZSE/NPqLu36Nur0miCFfQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"@typescript-eslint/eslint-plugin": {
|
||||||
|
"version": "2.27.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.27.0.tgz",
|
||||||
|
"integrity": "sha512-/my+vVHRN7zYgcp0n4z5A6HAK7bvKGBiswaM5zIlOQczsxj/aiD7RcgD+dvVFuwFaGh5+kM7XA6Q6PN0bvb1tw==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@typescript-eslint/experimental-utils": "2.27.0",
|
||||||
|
"functional-red-black-tree": "^1.0.1",
|
||||||
|
"regexpp": "^3.0.0",
|
||||||
|
"tsutils": "^3.17.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"regexpp": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@typescript-eslint/experimental-utils": {
|
||||||
|
"version": "2.27.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.27.0.tgz",
|
||||||
|
"integrity": "sha512-vOsYzjwJlY6E0NJRXPTeCGqjv5OHgRU1kzxHKWJVPjDYGbPgLudBXjIlc+OD1hDBZ4l1DLbOc5VjofKahsu9Jw==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/json-schema": "^7.0.3",
|
||||||
|
"@typescript-eslint/typescript-estree": "2.27.0",
|
||||||
|
"eslint-scope": "^5.0.0",
|
||||||
|
"eslint-utils": "^2.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"eslint-utils": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"eslint-visitor-keys": "^1.1.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@typescript-eslint/parser": {
|
||||||
|
"version": "2.27.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.27.0.tgz",
|
||||||
|
"integrity": "sha512-HFUXZY+EdwrJXZo31DW4IS1ujQW3krzlRjBrFRrJcMDh0zCu107/nRfhk/uBasO8m0NVDbBF5WZKcIUMRO7vPg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/eslint-visitor-keys": "^1.0.0",
|
||||||
|
"@typescript-eslint/experimental-utils": "2.27.0",
|
||||||
|
"@typescript-eslint/typescript-estree": "2.27.0",
|
||||||
|
"eslint-visitor-keys": "^1.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@typescript-eslint/typescript-estree": {
|
||||||
|
"version": "2.27.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.27.0.tgz",
|
||||||
|
"integrity": "sha512-t2miCCJIb/FU8yArjAvxllxbTiyNqaXJag7UOpB5DVoM3+xnjeOngtqlJkLRnMtzaRcJhe3CIR9RmL40omubhg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"debug": "^4.1.1",
|
||||||
|
"eslint-visitor-keys": "^1.1.0",
|
||||||
|
"glob": "^7.1.6",
|
||||||
|
"is-glob": "^4.0.1",
|
||||||
|
"lodash": "^4.17.15",
|
||||||
|
"semver": "^6.3.0",
|
||||||
|
"tsutils": "^3.17.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"debug": {
|
||||||
|
"version": "4.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
|
||||||
|
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"ms": "^2.1.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ms": {
|
||||||
|
"version": "2.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||||
|
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"semver": {
|
||||||
|
"version": "6.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||||
|
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"@webassemblyjs/ast": {
|
"@webassemblyjs/ast": {
|
||||||
"version": "1.8.5",
|
"version": "1.8.5",
|
||||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz",
|
"resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz",
|
||||||
@@ -10336,12 +10495,85 @@
|
|||||||
"glob": "^7.1.2"
|
"glob": "^7.1.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ts-loader": {
|
||||||
|
"version": "6.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-6.2.2.tgz",
|
||||||
|
"integrity": "sha512-HDo5kXZCBml3EUPcc7RlZOV/JGlLHwppTLEHb3SHnr5V7NXD4klMEkrhJe5wgRbaWsSXi+Y1SIBN/K9B6zWGWQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"chalk": "^2.3.0",
|
||||||
|
"enhanced-resolve": "^4.0.0",
|
||||||
|
"loader-utils": "^1.0.2",
|
||||||
|
"micromatch": "^4.0.0",
|
||||||
|
"semver": "^6.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"braces": {
|
||||||
|
"version": "3.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
||||||
|
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"fill-range": "^7.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fill-range": {
|
||||||
|
"version": "7.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
||||||
|
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"to-regex-range": "^5.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"is-number": {
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"micromatch": {
|
||||||
|
"version": "4.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz",
|
||||||
|
"integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"braces": "^3.0.1",
|
||||||
|
"picomatch": "^2.0.5"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"semver": {
|
||||||
|
"version": "6.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||||
|
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"to-regex-range": {
|
||||||
|
"version": "5.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||||
|
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"is-number": "^7.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"tslib": {
|
"tslib": {
|
||||||
"version": "1.10.0",
|
"version": "1.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",
|
||||||
"integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==",
|
"integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"tsutils": {
|
||||||
|
"version": "3.17.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz",
|
||||||
|
"integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"tslib": "^1.8.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"tty-browserify": {
|
"tty-browserify": {
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz",
|
||||||
@@ -10400,6 +10632,18 @@
|
|||||||
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
|
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"typescript": {
|
||||||
|
"version": "3.8.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz",
|
||||||
|
"integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"typescript-eslint": {
|
||||||
|
"version": "0.0.1-alpha.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-0.0.1-alpha.0.tgz",
|
||||||
|
"integrity": "sha512-1hNKM37dAWML/2ltRXupOq2uqcdRQyDFphl+341NTPXFLLLiDhErXx8VtaSLh3xP7SyHZdcCgpt9boYYVb3fQg==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"uglify-to-browserify": {
|
"uglify-to-browserify": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz",
|
||||||
|
|||||||
16
package.json
16
package.json
@@ -13,7 +13,8 @@
|
|||||||
"build": "bundle install && npm install && npm run bundle",
|
"build": "bundle install && npm install && npm run bundle",
|
||||||
"submodules": "git submodule update --init --force --remote",
|
"submodules": "git submodule update --init --force --remote",
|
||||||
"test": "karma start karma.conf.js --single-run",
|
"test": "karma start karma.conf.js --single-run",
|
||||||
"lint": "eslint --fix app/assets/javascripts/**/*.js"
|
"lint": "eslint --fix app/assets/javascripts/**/*.js",
|
||||||
|
"tsc": "tsc --project app/assets/javascripts/tsconfig.json"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.8.4",
|
"@babel/cli": "^7.8.4",
|
||||||
@@ -22,6 +23,14 @@
|
|||||||
"@babel/plugin-transform-runtime": "^7.8.3",
|
"@babel/plugin-transform-runtime": "^7.8.3",
|
||||||
"@babel/preset-env": "^7.8.7",
|
"@babel/preset-env": "^7.8.7",
|
||||||
"@babel/runtime": "^7.8.7",
|
"@babel/runtime": "^7.8.7",
|
||||||
|
"@babel/preset-typescript": "^7.8.3",
|
||||||
|
"@types/angular": "^1.7.0",
|
||||||
|
"@types/chai": "^4.2.11",
|
||||||
|
"@types/lodash": "^4.14.149",
|
||||||
|
"@types/mocha": "^7.0.2",
|
||||||
|
"@types/node": "^12.12.30",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^2.23.0",
|
||||||
|
"@typescript-eslint/parser": "^2.23.0",
|
||||||
"angular": "1.7.9",
|
"angular": "1.7.9",
|
||||||
"apply-loader": "^2.0.0",
|
"apply-loader": "^2.0.0",
|
||||||
"babel-eslint": "^10.1.0",
|
"babel-eslint": "^10.1.0",
|
||||||
@@ -48,8 +57,11 @@
|
|||||||
"pug-loader": "^2.4.0",
|
"pug-loader": "^2.4.0",
|
||||||
"sass-loader": "^8.0.2",
|
"sass-loader": "^8.0.2",
|
||||||
"serve-static": "^1.14.1",
|
"serve-static": "^1.14.1",
|
||||||
"snjs": "github:standardnotes/snjs#ea2f182ba4b53642516714396bbef264f25e373b",
|
|
||||||
"sn-stylekit": "2.0.22",
|
"sn-stylekit": "2.0.22",
|
||||||
|
"snjs": "github:standardnotes/snjs#ea2f182ba4b53642516714396bbef264f25e373b",
|
||||||
|
"ts-loader": "^6.2.2",
|
||||||
|
"typescript": "^3.8.3",
|
||||||
|
"typescript-eslint": "0.0.1-alpha.0",
|
||||||
"webpack": "^4.42.0",
|
"webpack": "^4.42.0",
|
||||||
"webpack-cli": "^3.3.11",
|
"webpack-cli": "^3.3.11",
|
||||||
"webpack-dev-server": "^3.10.3"
|
"webpack-dev-server": "^3.10.3"
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
devtool: 'source-map',
|
devtool: 'source-map',
|
||||||
resolve: {
|
resolve: {
|
||||||
|
extensions: ['.ts', '.js'],
|
||||||
alias: {
|
alias: {
|
||||||
'%': path.resolve(__dirname, 'app/assets/templates'),
|
'%': path.resolve(__dirname, 'app/assets/templates'),
|
||||||
'@': path.resolve(__dirname, 'app/assets/javascripts'),
|
'@': path.resolve(__dirname, 'app/assets/javascripts'),
|
||||||
@@ -41,7 +42,7 @@ module.exports = {
|
|||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.js$/,
|
test: /\.(js|ts)$/,
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
use: {
|
use: {
|
||||||
loader: 'babel-loader'
|
loader: 'babel-loader'
|
||||||
|
|||||||
Reference in New Issue
Block a user