UNPKG

@hazae41/kdbx

Version:

Rust-like KeePass (KDBX 4) file format for TypeScript

158 lines (157 loc) 6.44 kB
import type { Nullable } from "../../../../../libs/nullable/mod.ts"; export declare class KeePassFile { readonly document: Document; constructor(document: Document); static decodeOrThrow(bytes: Uint8Array): KeePassFile; encodeOrThrow(): Uint8Array<ArrayBuffer>; cloneOrThrow(): KeePassFile; getMetaOrThrow(): KeePassFile.Meta; getRootOrThrow(): KeePassFile.Root; } export declare namespace KeePassFile { class Meta { readonly element: Element; constructor(element: Element); getDatabaseNameOrNull(): Nullable<Other.AsString>; getDatabaseNameChangedOrNull(): Nullable<Other.AsDate>; setDatabaseNameChanged(date?: Date): void; getGeneratorOrNull(): Nullable<Other.AsString>; getHistoryMaxItemsOrNull(): Nullable<Other.AsInteger>; getHistoryMaxSizeOrNull(): Nullable<Other.AsInteger>; getRecycleBinEnabledOrNull(): Nullable<Other.AsBoolean>; getRecycleBinUuidOrThrow(): Other.AsUuid; getRecycleBinChangedOrNull(): Nullable<Other.AsDate>; setRecycleBinChanged(date?: Date): void; getSettingsChangedOrNull(): Nullable<Other.AsDate>; setSettingsChanged(date?: Date): void; getDatabaseDescriptionOrNull(): Nullable<Other.AsString>; getDatabaseDescriptionChangedOrNull(): Nullable<Other.AsDate>; setDatabaseDescriptionChanged(date?: Date): void; getDefaultUserNameOrNull(): Nullable<Other.AsString>; getDefaultUserNameChangedOrNull(): Nullable<Other.AsDate>; setDefaultUserNameChanged(date?: Date): void; getColorOrNull(): Nullable<Other.AsString>; getEntryTemplatesGroupOrNull(): Nullable<Other.AsString>; getEntryTemplatesGroupChangedOrNull(): Nullable<Other.AsDate>; setEntryTemplatesGroupChanged(date?: Date): void; } class Root { readonly element: Element; constructor(element: Element); addGroupOrThrow(name: string): KeePassFile.Group; getGroups(): Generator<Group>; getGroupByUuidOrThrow(uuid: string): Group; getGroupByUuidOrNull(uuid: string): Nullable<Group>; getDirectGroups(): Generator<Group>; getDirectGroupByIndexOrThrow(index: number): Group; getDirectGroupByIndexOrNull(index: number): Nullable<Group>; getDirectGroupByUuidOrThrow(uuid: string): Group; getDirectGroupByUuidOrNull(uuid: string): Nullable<Group>; } class Group { readonly element: Element; constructor(element: Element); addEntryOrThrow(): KeePassFile.Entry; moveOrThrow(group: Group): void; getNameOrThrow(): Other.AsString; getUuidOrThrow(): Other.AsUuid; getTimesOrNew(): Times; getIconIdOrThrow(): Other.AsInteger; getEnableAutoTypeOrThrow(): Other.AsBoolean; getEnableSearchingOrThrow(): Other.AsBoolean; getDirectGroups(): Generator<Group>; getDirectGroupByIndexOrThrow(index: number): Group; getDirectGroupByIndexOrNull(index: number): Nullable<Group>; getDirectGroupByUuidOrThrow(uuid: string): Group; getDirectGroupByUuidOrNull(uuid: string): Nullable<Group>; getDirectEntries(): Generator<Entry>; getDirectEntryByIndexOrThrow(index: number): Entry; getDirectEntryByIndexOrNull(index: number): Nullable<Entry>; getDirectEntryByUuidOrThrow(uuid: string): Entry; getDirectEntryByUuidOrNull(uuid: string): Nullable<Entry>; } class Times { readonly element: Element; constructor(element: Element); getCreationTimeOrThrow(): Other.AsDate; getLastModificationTimeOrNull(): Nullable<Other.AsDate>; setLastModificationTime(date?: Date): void; getLastAccessTimeOrNull(): Nullable<Other.AsDate>; setLastAccessTime(date?: Date): void; getExpiresOrNull(): Nullable<Other.AsBoolean>; getUsageCountOrNull(): Nullable<Other.AsInteger>; incrementUsageCount(): void; getLocationChangedOrNull(): Nullable<Other.AsDate>; setLocationChanged(date?: Date): void; } class Entry { readonly element: Element; constructor(element: Element); saveOrThrow(): Entry; moveOrThrow($group: Group): void; trashOrThrow(): void; addStringOrThrow(key: string, value: string, protect?: boolean): String; getUuidOrThrow(): Other.AsUuid; getTimesOrNew(): Times; getHistoryOrNull(): Nullable<History>; getHistoryOrNew(): History; getStrings(): Generator<String>; getStringByIndexOrNull(index: number): Nullable<String>; getStringByKeyOrNull(key: string): Nullable<String>; } class String { readonly element: Element; constructor(element: Element); getKeyOrThrow(): Other.AsString; getValueOrThrow(): Other.AsString; } class Value { readonly element: Element; constructor(element: Element); get(): string; set(value: string): void; get protected(): boolean; set protected(value: boolean); } class History { readonly element: Element; constructor(element: Element); pushOrThrow($entry: Entry): Entry; cleanOrThrow(): void; getDirectEntries(): Generator<Entry>; getDirectEntryByIndexOrNull(index: number): Nullable<Entry>; } namespace Other { class AsString { readonly element: Element; constructor(element: Element); get(): string; set(value: string): void; } class AsBoolean { readonly element: Element; constructor(element: Element); get(): boolean; set(value: boolean): void; } class AsInteger { readonly element: Element; constructor(element: Element); getOrThrow(): number; setOrThrow(value: number): void; incrementOrThrow(): void; } class AsDate { readonly element: Element; constructor(element: Element); getOrThrow(): Date; setOrThrow(value: Date): void; } class AsUuid { readonly element: Element; constructor(element: Element); getOrThrow(): string; setOrThrow(value: string): void; } } }