UNPKG

tinacms

Version:

[![GitHub license](https://img.shields.io/github/license/tinacms/tinacms?color=blue)](https://github.com/tinacms/tinacms/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/tinacms.svg?style=flat)](https://www.npmjs.com/package/tinacms) [![Bui

47 lines (46 loc) 1.91 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; relativePathWithoutExtension?: 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<CollectionResponse | Collection>; 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>; }