UNPKG

@knapsack/app

Version:

Build Design Systems on top of knapsack, by Basalt

101 lines (99 loc) 3.62 kB
/** * Copyright (C) 2018 Basalt This file is part of Knapsack. Knapsack is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Knapsack is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Knapsack; if not, see <https://www.gnu.org/licenses>. */ import { DocumentNode } from 'graphql'; import { KnapsackTemplateDemo } from '../schemas/patterns'; import * as Files from '../schemas/api/files'; import * as Plugins from '../schemas/api/plugins'; import { AppState } from './store'; import { KsRenderResults, KsTemplateRenderedMeta, KsTemplateUrls } from '../schemas/knapsack-config'; import { FileResponse } from '../schemas/misc'; import { PatternRenderData } from '../schemas/api/render'; export { Files }; /** * GraphQL Query Object to String * @param gqlQueryObject - GraphQL query made from `gql` - https://github.com/apollographql/graphql-tag/issues/150 * @return {string} */ export declare function gqlToString(gqlQueryObject: DocumentNode): string; export interface GraphQlResponse { data?: any; errors?: { message: string; extensions: { code: string; stacktrace: string[]; }; locations: { line: number; column: number; }[]; }[]; } /** * GraphQL Query * Must pass in `query` OR `gqlQuery` */ export declare function gqlQuery({ query, gqlQueryObj, variables, }: { /** * Plain GraphQL query */ query?: string | DocumentNode; /** * GraphQL query made from `gql` */ gqlQueryObj?: DocumentNode; /** * GraphQL variables */ variables?: object; }): Promise<GraphQlResponse>; declare type KnapsackDesignToken = import('@knapsack/core/types').KnapsackDesignToken; export declare function getDesignTokens(): Promise<KnapsackDesignToken[]>; export declare function files(x: Files.Actions): Promise<Files.ActionResponses>; export declare function getPluginContent({ pluginId, }: { pluginId: string; }): Promise<Plugins.GetContentResponse>; /** * Save data up on server to be used in template rendering with `dataId` query param later * @returns dataId that is md5 hash */ export declare function saveData(data: object): Promise<string>; export declare function uploadFile(file: File): Promise<FileResponse>; export declare function getInitialState(): Promise<AppState>; export declare function renderTemplate(options: PatternRenderData): Promise<KsRenderResults>; /** * Get a URL where this Pattern's Template can be viewed */ export declare function getTemplateUrls({ patternId, templateId, assetSetId, demo, cacheBuster, }: { patternId: string; templateId?: string; assetSetId?: string; demo: KnapsackTemplateDemo; cacheBuster?: string; }): Promise<{ dataId: string; urls: KsTemplateUrls; }>; /** * Get a URL where this Pattern's Template can be viewed */ export declare function getTemplateInfo({ patternId, templateId, assetSetId, demo, cacheBuster, }: { patternId: string; templateId?: string; assetSetId?: string; demo: KnapsackTemplateDemo; cacheBuster?: string; }): Promise<KsTemplateRenderedMeta>; //# sourceMappingURL=data.d.ts.map