remove web-api in preload
This commit is contained in:
@@ -356,50 +356,6 @@ contextBridge.exposeInMainWorld("__ENJOY_APP__", {
|
||||
ipcRenderer.removeAllListeners("download-on-error");
|
||||
},
|
||||
},
|
||||
webApi: {
|
||||
auth: (params: object) => {
|
||||
return ipcRenderer.invoke("web-api-auth", params);
|
||||
},
|
||||
me: () => {
|
||||
return ipcRenderer.invoke("web-api-me");
|
||||
},
|
||||
lookup: (params: object) => {
|
||||
return ipcRenderer.invoke("web-api-lookup", params);
|
||||
},
|
||||
lookupInBatch: (params: object[]) => {
|
||||
return ipcRenderer.invoke("web-api-lookup-in-batch", params);
|
||||
},
|
||||
createStory: (params: object) => {
|
||||
return ipcRenderer.invoke("web-api-create-story", params);
|
||||
},
|
||||
starStory: (storyId: string) => {
|
||||
return ipcRenderer.invoke("web-api-star-story", storyId);
|
||||
},
|
||||
unstarStory: (storyId: string) => {
|
||||
return ipcRenderer.invoke("web-api-unstar-story", storyId);
|
||||
},
|
||||
extractVocabularyFromStory: (storyId: string) => {
|
||||
return ipcRenderer.invoke(
|
||||
"web-api-extract-vocabulary-from-story",
|
||||
storyId
|
||||
);
|
||||
},
|
||||
storyMeanings: (storyId: string, params: object) => {
|
||||
return ipcRenderer.invoke("web-api-story-meanings", storyId, params);
|
||||
},
|
||||
story: (id: string) => {
|
||||
return ipcRenderer.invoke("web-api-story", id);
|
||||
},
|
||||
stories: (params: object) => {
|
||||
return ipcRenderer.invoke("web-api-stories", params);
|
||||
},
|
||||
mineStories: (params: object) => {
|
||||
return ipcRenderer.invoke("web-api-mine-stories", params);
|
||||
},
|
||||
mineMeanings: (params: object) => {
|
||||
return ipcRenderer.invoke("web-api-mine-meanings", params);
|
||||
},
|
||||
},
|
||||
cacheObjects: {
|
||||
get: (key: string) => {
|
||||
return ipcRenderer.invoke("cache-objects-get", key);
|
||||
|
||||
64
enjoy/src/types/enjoy-app.d.ts
vendored
64
enjoy/src/types/enjoy-app.d.ts
vendored
@@ -185,70 +185,6 @@ type EnjoyAppType = {
|
||||
dashboard: () => Promise<DownloadStateType[]>;
|
||||
removeAllListeners: () => void;
|
||||
};
|
||||
webApi: {
|
||||
auth: (params: { provider: string; code: string }) => Promise<UserType>;
|
||||
me: () => Promise<UserType>;
|
||||
lookup: (params: {
|
||||
word: string;
|
||||
context?: string;
|
||||
sourceId?: string;
|
||||
sourceType?: string;
|
||||
}) => Promise<LookupType>;
|
||||
lookupInBatch: (
|
||||
params: {
|
||||
word: string;
|
||||
context?: string;
|
||||
sourceId?: string;
|
||||
sourceType?: string;
|
||||
}[]
|
||||
) => Promise<{ successCount: number; errors: string[]; total: number }>;
|
||||
mineMeanings: (params?: {
|
||||
page?: number;
|
||||
items?: number;
|
||||
sourceId?: string;
|
||||
sourceType?: string;
|
||||
}) => Promise<
|
||||
{
|
||||
meanings: MeaningType[];
|
||||
} & PagyResponseType
|
||||
>;
|
||||
createStory: (params: {
|
||||
title: string;
|
||||
content: string;
|
||||
url: string;
|
||||
metadata: {
|
||||
[key: string]: any;
|
||||
};
|
||||
}) => Promise<StoryType>;
|
||||
extractVocabularyFromStory: (id: string) => Promise<string[]>;
|
||||
story: (id: string) => Promise<StoryType>;
|
||||
stories: (params?: { page: number }) => Promise<{
|
||||
stories: StoryType[];
|
||||
page: number;
|
||||
next: number | null;
|
||||
}>;
|
||||
mineStories: (params?: { page: number }) => Promise<{
|
||||
stories: StoryType[];
|
||||
page: number;
|
||||
next: number | null;
|
||||
}>;
|
||||
storyMeanings: (
|
||||
storyId: string,
|
||||
params?: {
|
||||
page?: number;
|
||||
items?: number;
|
||||
sourceId?: string;
|
||||
sourceType?: string;
|
||||
}
|
||||
) => Promise<
|
||||
{
|
||||
meanings: MeaningType[];
|
||||
pendingLookups: LookupType[];
|
||||
} & PagyResponseType
|
||||
>;
|
||||
starStory: (id: string) => Promise<{ starred: boolean }>;
|
||||
unstarStory: (id: string) => Promise<{ starred: boolean }>;
|
||||
};
|
||||
cacheObjects: {
|
||||
get: (key: string) => Promise<any>;
|
||||
set: (key: string, value: any, ttl?: number) => Promise<void>;
|
||||
|
||||
Reference in New Issue
Block a user