import * as _octokit_openapi_types from '@octokit/openapi-types'; import { RequestParameters, OctokitResponse, Endpoints } from '@octokit/types'; import { ReactNode } from 'react'; declare type FilterConditionally = Pick; declare type GetEndpoints = FilterConditionally; declare function onRequestGitHubEndpoint(route: Endpoint, parameters?: EndpointParameters & RequestParameters): Promise["data"]["response"]["data"]>; declare type OnRequestGitHubEndpoint = typeof onRequestGitHubEndpoint; interface Block { id: string; type: string; title: string; description: string; entry: string; extensions?: string[]; matches?: string[]; owner: string; repo: string; } interface BlocksRepo { owner: string; repo: string; full_name: string; html_url: string; description: string; stars: number; watchers: number; language: string; topics: string[]; blocks: Block[]; } declare type FileContext = { file: string; path: string; repo: string; owner: string; sha: string; }; declare type FolderContext = { folder: string; path: string; repo: string; owner: string; sha: string; }; declare type CommonBlockProps = { block: Block; metadata: any; onUpdateMetadata: (_: any) => void; onNavigateToPath: (_: string) => void; onRequestUpdateContent: (_: string) => void; onUpdateContent: (_: string) => void; onRequestGitHubEndpoint: OnRequestGitHubEndpoint; onRequestGitHubData: (path: string, params?: Record, rawData?: boolean) => Promise; onRequestBlocksRepos: (params?: { path?: string; searchTerm?: string; repoUrl?: string; type?: "file" | "folder"; }) => Promise; BlockComponent: ({ block, context, }: { block: { owner: string; repo: string; id: string; }; context?: { owner?: string; repo?: string; path?: string; sha?: string; }; }) => JSX.Element; onStoreGet: (key: string) => Promise; onStoreSet: (key: string, value: any) => Promise; }; declare type FileContent = { content: string; context: FileContext; }; declare type FileData = { content: string; originalContent: string; isEditable: boolean; context: FileContext; }; declare type FileBlockProps = FileData & CommonBlockProps; declare type TreeItem = _octokit_openapi_types.components["schemas"]["git-tree"]["tree"][number]; declare type FolderData = { tree: TreeItem[]; context: FolderContext; }; declare type FolderBlockProps = FolderData & CommonBlockProps; declare type FileImport = { moduleName: string; starImport: string; namedImports: { name: string; alias: string; }[]; defaultImport: string; sideEffectOnly: boolean; }; declare type RepoFiles = TreeItem[]; declare type LightFileData = { contents: string; path: string; }; declare type GetFileContent = (path: string) => Promise; interface UseFileContentParams { path: string; } declare function getLanguageFromFilename(filename: string): string; interface NestedFileTree { children: NestedFileTree[]; name: string; path: string; parent: string; size: number; type: string; } declare function getNestedFileTree(files: TreeItem[]): NestedFileTree[]; declare type BlockPickerProps = { value: Block; onChange: (block: Block) => void; onRequestBlocksRepos: CommonBlockProps["onRequestBlocksRepos"]; children?: ReactNode; }; declare const BlockPicker: ({ value, onChange, onRequestBlocksRepos, children, }: BlockPickerProps) => JSX.Element; export { Block, BlockPicker, BlocksRepo, CommonBlockProps, FileBlockProps, FileContent, FileContext, FileData, FileImport, FolderBlockProps, FolderContext, FolderData, GetFileContent, LightFileData, RepoFiles, TreeItem, UseFileContentParams, getLanguageFromFilename, getNestedFileTree };