UNPKG

tinacms

Version:

> The Fastest Way to Edit Next.js Content

46 lines (45 loc) 1.87 kB
import type { TinaCMS } from '@tinacms/toolkit'; import type { Collection, TinaSchema } from '@tinacms/schema-tools'; import type { Client } from '../internalClient'; import type { CollectionResponse, DocumentForm } from './types'; import { SearchClient } from '@tinacms/search/dist/index-client'; export interface FilterArgs { filterField: string; collection?: string; relativePath?: string; newRelativePath?: string; startsWith?: string; endsWith?: string; before?: string; after?: string; booleanEquals?: boolean; } export declare class TinaAdminApi { api: Client; useDataLayer: boolean; schema: TinaSchema; searchClient?: SearchClient; maxSearchIndexFieldLength: number; constructor(cms: TinaCMS); isAuthenticated(): Promise<boolean>; checkGraphqlSchema({ localSchema }: { localSchema: any; }): Promise<boolean>; fetchCollections(): Collection<true>[]; renameDocument({ collection, relativePath, newRelativePath }: { collection: any; relativePath: any; newRelativePath: any; }): Promise<void>; deleteDocument({ collection, relativePath, }: { collection: string; relativePath: string; }): Promise<void>; fetchCollection(collectionName: string, includeDocuments: boolean, folder?: string, after?: string, sortKey?: string, order?: 'asc' | 'desc', filterArgs?: FilterArgs): Promise<Collection<false> | CollectionResponse>; fetchDocument(collectionName: string, relativePath: string, values?: boolean): Promise<{ document: DocumentForm; }>; createDocument(collection: Collection, relativePath: string, params: Object): Promise<unknown>; updateDocument(collection: Collection, relativePath: string, params: Object): Promise<unknown>; createFolder(collection: any, folderName: any): Promise<unknown>; }