typescript-github-action-template 0.2.2-0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,19 @@
1
+ import type { DocumentTypeDecoration, ResultOf } from '@graphql-typed-document-node/core';
2
+ import type { Incremental, TypedDocumentString } from './graphql.js';
3
+ export type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> = TDocumentType extends DocumentTypeDecoration<infer TType, any> ? [TType] extends [{
4
+ ' $fragmentName'?: infer TKey;
5
+ }] ? TKey extends string ? {
6
+ ' $fragmentRefs'?: {
7
+ [key in TKey]: TType;
8
+ };
9
+ } : never : never : never;
10
+ export declare function useFragment<TType>(_documentNode: DocumentTypeDecoration<TType, any>, fragmentType: FragmentType<DocumentTypeDecoration<TType, any>>): TType;
11
+ export declare function useFragment<TType>(_documentNode: DocumentTypeDecoration<TType, any>, fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | undefined): TType | undefined;
12
+ export declare function useFragment<TType>(_documentNode: DocumentTypeDecoration<TType, any>, fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null): TType | null;
13
+ export declare function useFragment<TType>(_documentNode: DocumentTypeDecoration<TType, any>, fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null | undefined): TType | null | undefined;
14
+ export declare function useFragment<TType>(_documentNode: DocumentTypeDecoration<TType, any>, fragmentType: Array<FragmentType<DocumentTypeDecoration<TType, any>>>): Array<TType>;
15
+ export declare function useFragment<TType>(_documentNode: DocumentTypeDecoration<TType, any>, fragmentType: Array<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined): Array<TType> | null | undefined;
16
+ export declare function useFragment<TType>(_documentNode: DocumentTypeDecoration<TType, any>, fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>): ReadonlyArray<TType>;
17
+ export declare function useFragment<TType>(_documentNode: DocumentTypeDecoration<TType, any>, fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined): ReadonlyArray<TType> | null | undefined;
18
+ export declare function makeFragmentData<F extends DocumentTypeDecoration<any, any>, FT extends ResultOf<F>>(data: FT, _fragment: F): FragmentType<F>;
19
+ export declare function isFragmentReady<TQuery, TFrag>(queryNode: TypedDocumentString<TQuery, any>, fragmentNode: TypedDocumentString<TFrag, any>, data: FragmentType<TypedDocumentString<Incremental<TFrag>, any>> | null | undefined): data is FragmentType<typeof fragmentNode>;
@@ -0,0 +1,15 @@
1
+ export function useFragment(_documentNode, fragmentType) {
2
+ return fragmentType;
3
+ }
4
+ export function makeFragmentData(data, _fragment) {
5
+ return data;
6
+ }
7
+ export function isFragmentReady(queryNode, fragmentNode, data) {
8
+ var _a, _b, _c;
9
+ const deferredFields = (_a = queryNode.__meta__) === null || _a === void 0 ? void 0 : _a.deferredFields;
10
+ const fragName = (_b = fragmentNode.__meta__) === null || _b === void 0 ? void 0 : _b.fragmentName;
11
+ if (!deferredFields || !fragName)
12
+ return true;
13
+ const fields = (_c = deferredFields[fragName]) !== null && _c !== void 0 ? _c : [];
14
+ return fields.length > 0 && fields.every((field) => data && field in data);
15
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
3
+ */
4
+ export declare function graphql(source: '\n query ViewerLogin {\n viewer {\n login\n }\n }\n'): typeof import('./graphql.js').ViewerLoginDocument;
@@ -0,0 +1,19 @@
1
+ /* eslint-disable */
2
+ import * as types from './graphql.js';
3
+ /**
4
+ * Map of all GraphQL operations in the project.
5
+ *
6
+ * This map has several performance disadvantages:
7
+ * 1. It is not tree-shakeable, so it will include all operations in the project.
8
+ * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.
9
+ * 3. It does not support dead code elimination, so it will add unused operations.
10
+ *
11
+ * Therefore it is highly recommended to use the babel or swc plugin for production.
12
+ */
13
+ const documents = {
14
+ '\n query ViewerLogin {\n viewer {\n login\n }\n }\n': types.ViewerLoginDocument,
15
+ };
16
+ export function graphql(source) {
17
+ var _a;
18
+ return (_a = documents[source]) !== null && _a !== void 0 ? _a : {};
19
+ }