@aws-amplify/core
Version:
Core category of aws-amplify
33 lines (32 loc) • 1.01 kB
TypeScript
interface WithBytesSize {
readonly bytesSize: number;
}
export interface ItemToAdd {
readonly content: string;
readonly timestamp: string;
}
export interface QueuedItemWeb extends ItemToAdd, WithBytesSize {
readonly id: number;
readonly key?: never;
}
export interface QueuedItemNative extends ItemToAdd, WithBytesSize {
readonly id?: never;
readonly key: string;
}
export type QueuedItem = QueuedItemWeb | QueuedItemNative;
export interface AddItemWithAuthPropertiesWeb extends ItemToAdd, WithBytesSize {
}
export interface AddItemWithAuthPropertiesNative extends ItemToAdd, WithBytesSize {
key: QueuedItemNative['key'];
}
export interface QueuedStorage {
add(item: ItemToAdd, options?: {
dequeueBeforeEnqueue: boolean;
}): Promise<void>;
peek(n?: number): Promise<QueuedItem[]>;
peekAll(): Promise<QueuedItem[]>;
delete(items: QueuedItem[]): Promise<void>;
clear(): Promise<void>;
isFull(maxBytesSizeInMiB: number): boolean;
}
export {};