UNPKG

@tokens-studio/sdk

Version:
82 lines 3.1 kB
import type { TypedDocumentNode } from '@graphql-typed-document-node/core'; import type { ApolloClient, OperationVariables } from '@apollo/client/core/index.js'; import { type GetArtifactUrlQueryVariables, type GetConfigsQueryVariables, type GetProjectsQueryVariables, type GetReleaseQueryVariables, type GetReleasesVersionsQueryVariables, type GetThemesQueryVariables, type GetTokenSetsQueryVariables } from '../../__generated__/graphql.js'; declare interface IRunQuery<T, Vars extends OperationVariables> { client: ApolloClient<unknown>; queryDocument: TypedDocumentNode<T, Vars>; variables?: Vars; } export declare const runQuery: <T, Vars extends OperationVariables>({ client, queryDocument, variables, }: IRunQuery<T, Vars>) => () => Promise<T>; export declare const getOrgs: (client: ApolloClient<unknown>) => Promise<{ totalPages: number; data: Array<{ name: string; id: string; }>; }>; export declare const getProjects: (client: ApolloClient<unknown>, variables: GetProjectsQueryVariables) => Promise<{ totalPages: number; data: Array<{ id: string; name: string; organizationId: string; branches: { data: Array<{ name: string; isDefault: boolean; }>; }; }>; }>; export declare const getConfigs: (client: ApolloClient<unknown>, variables: GetConfigsQueryVariables) => Promise<{ totalPages: number; data: Array<{ name: string; config: any; functions: string; themeOptions: any; }>; }>; export declare const getThemes: (client: ApolloClient<unknown>, variables: GetThemesQueryVariables) => Promise<{ totalPages: number; data: Array<{ name: string; options?: Array<{ name: string; selectedTokenSets: any; figmaStyleReferences?: any | null; figmaVariableReferences?: any | null; figmaCollectionId?: string | null; figmaModeId?: string | null; }> | null; }>; }>; export declare const getSets: (client: ApolloClient<unknown>, variables: GetTokenSetsQueryVariables) => Promise<{ data: { tokensObject: any; graph: any; name: string; raw?: any | null; type: import("../../__generated__/graphql.js").TokenSetType; orderIndex: number; source?: { graph: any; } | null; }[]; totalPages: number; }>; export declare const getReleaseVersions: (client: ApolloClient<unknown>, variables: GetReleasesVersionsQueryVariables) => Promise<{ totalPages: number; data: Array<{ version: string; }>; }>; export declare const getRelease: (client: ApolloClient<unknown>, variables: GetReleaseQueryVariables) => Promise<{ name: string; createdAt: any; configArtifactUrl?: string | null; tokensArtifactUrl?: string | null; }>; export declare const getArtifactUrl: (client: ApolloClient<unknown>, variables: GetArtifactUrlQueryVariables) => Promise<string>; export {}; //# sourceMappingURL=queries.d.ts.map