@remcostoeten/fync
Version:
Unified TypeScript library for 9 popular APIs with consistent functional architecture
135 lines • 4.59 kB
TypeScript
import { type TModule } from "../core";
declare const resources: {
pages: import("../core").TResourceConfig<{
getPage: {
path: string;
};
createPage: {
path: string;
method: "POST";
};
updatePage: {
path: string;
method: "PATCH";
};
getPageProperty: {
path: string;
};
}>;
databases: import("../core").TResourceConfig<{
getDatabase: {
path: string;
};
createDatabase: {
path: string;
method: "POST";
};
updateDatabase: {
path: string;
method: "PATCH";
};
queryDatabase: {
path: string;
method: "POST";
};
}>;
blocks: import("../core").TResourceConfig<{
getBlock: {
path: string;
};
updateBlock: {
path: string;
method: "PATCH";
};
deleteBlock: {
path: string;
method: "DELETE";
};
getBlockChildren: {
path: string;
};
appendBlockChildren: {
path: string;
method: "PATCH";
};
}>;
users: import("../core").TResourceConfig<{
getUser: {
path: string;
};
getCurrentUser: {
path: string;
};
listUsers: {
path: string;
};
}>;
comments: import("../core").TResourceConfig<{
createComment: {
path: string;
method: "POST";
};
getComments: {
path: string;
};
}>;
search: import("../core").TResourceConfig<{
search: {
path: string;
method: "POST";
};
}>;
};
type TNotionModule = TModule<typeof resources> & {
getPage: (pageId: string) => Promise<any>;
createPage: (data: any) => Promise<any>;
updatePage: (pageId: string, data: any) => Promise<any>;
archivePage: (pageId: string) => Promise<any>;
getPageProperty: (pageId: string, propertyId: string) => Promise<any>;
getDatabase: (databaseId: string) => Promise<any>;
createDatabase: (data: any) => Promise<any>;
updateDatabase: (databaseId: string, data: any) => Promise<any>;
queryDatabase: (databaseId: string, query?: any) => Promise<any>;
getBlock: (blockId: string) => Promise<any>;
updateBlock: (blockId: string, data: any) => Promise<any>;
deleteBlock: (blockId: string) => Promise<any>;
getBlockChildren: (blockId: string, startCursor?: string, pageSize?: number) => Promise<any>;
appendBlockChildren: (blockId: string, children: any[]) => Promise<any>;
getUser: (userId: string) => Promise<any>;
getCurrentUser: () => Promise<any>;
listUsers: (startCursor?: string, pageSize?: number) => Promise<any>;
createComment: (data: any) => Promise<any>;
getComments: (blockId: string, startCursor?: string, pageSize?: number) => Promise<any>;
search: (query: string, options?: any) => Promise<any>;
searchPages: (query: string, options?: any) => Promise<any>;
searchDatabases: (query: string, options?: any) => Promise<any>;
createPageInDatabase: (databaseId: string, properties: Record<string, any>, content?: any[]) => Promise<any>;
createPageWithContent: (parent: {
type: string;
[key: string]: any;
}, title: string, content: any[]) => Promise<any>;
createRichText: (text: string) => Array<{
type: "text";
text: {
content: string;
link: null;
};
plain_text: string;
href: null;
}>;
addTextBlock: (blockId: string, text: string, type?: string) => Promise<any>;
addToDoBlock: (blockId: string, text: string, checked?: boolean) => Promise<any>;
addBulletedListItem: (blockId: string, text: string) => Promise<any>;
addNumberedListItem: (blockId: string, text: string) => Promise<any>;
addToggleBlock: (blockId: string, text: string, children?: any[]) => Promise<any>;
addCalloutBlock: (blockId: string, text: string, emoji?: string) => Promise<any>;
addQuoteBlock: (blockId: string, text: string) => Promise<any>;
addCodeBlock: (blockId: string, code: string, language?: string) => Promise<any>;
addDividerBlock: (blockId: string) => Promise<any>;
};
export declare function Notion(config: {
token: string;
notionVersion?: string;
}): TNotionModule;
export type { TNotionModule };
//# sourceMappingURL=index.d.ts.map