@replyke/core
Version:
Replyke: Build interactive apps with social features like comments, votes, feeds, user lists, notifications, and more.
43 lines (42 loc) • 1.14 kB
TypeScript
import { Entity } from "../../interfaces/models/Entity";
import { Mention } from "../../interfaces/models/Mention";
import { UploadImageOptions } from "../../interfaces/models/Image";
type BrowserFile = File;
interface RNFile {
uri: string;
name: string;
type?: string;
}
type UniversalFile = BrowserFile | RNFile;
interface ImageUploadConfig {
files: UniversalFile[];
options?: UploadImageOptions;
}
interface FileUploadConfig {
files: UniversalFile[];
options?: {
pathParts?: string[];
};
}
export interface CreateEntityProps {
foreignId?: string;
sourceId?: string;
spaceId?: string;
title?: string;
content?: string;
attachments?: Record<string, any>[];
keywords?: string[];
mentions?: Mention[];
location?: {
latitude: number;
longitude: number;
};
metadata?: Record<string, any>;
excludeUserId?: boolean;
requireUser?: boolean;
isDraft?: boolean;
images?: ImageUploadConfig;
files?: FileUploadConfig;
}
declare function useCreateEntity(): (props: CreateEntityProps) => Promise<Entity>;
export default useCreateEntity;