move trash related types to types/trash
This commit is contained in:
parent
79f6ebc454
commit
4011b6fbe8
|
@ -87,8 +87,9 @@ import {
|
|||
getLocalTrash,
|
||||
getTrashedFiles,
|
||||
syncTrash,
|
||||
Trash,
|
||||
} from 'services/trashService';
|
||||
import { Trash } from 'types/trash';
|
||||
|
||||
import DeleteBtn from 'components/DeleteBtn';
|
||||
import FixCreationTime, {
|
||||
FixCreationTimeAttributes,
|
||||
|
|
|
@ -9,6 +9,7 @@ import { getCollection } from './collectionService';
|
|||
import { EnteFile } from 'types/file';
|
||||
|
||||
import HTTPService from './HTTPService';
|
||||
import { Trash, TrashItem } from 'types/trash';
|
||||
|
||||
const TRASH = 'file-trash';
|
||||
const TRASH_TIME = 'trash-time';
|
||||
|
@ -16,16 +17,6 @@ const DELETED_COLLECTION = 'deleted-collection';
|
|||
|
||||
const ENDPOINT = getEndpoint();
|
||||
|
||||
export interface TrashItem {
|
||||
file: EnteFile;
|
||||
isDeleted: boolean;
|
||||
isRestored: boolean;
|
||||
deleteBy: number;
|
||||
createdAt: number;
|
||||
updatedAt: number;
|
||||
}
|
||||
export type Trash = TrashItem[];
|
||||
|
||||
export async function getLocalTrash() {
|
||||
const trash = (await localForage.getItem<Trash>(TRASH)) || [];
|
||||
return trash;
|
||||
|
|
11
src/types/trash/index.ts
Normal file
11
src/types/trash/index.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { EnteFile } from 'types/file';
|
||||
|
||||
export interface TrashItem {
|
||||
file: EnteFile;
|
||||
isDeleted: boolean;
|
||||
isRestored: boolean;
|
||||
deleteBy: number;
|
||||
createdAt: number;
|
||||
updatedAt: number;
|
||||
}
|
||||
export type Trash = TrashItem[];
|
Loading…
Reference in a new issue