From d1eb89ea915fadcd5e2880b4746a436196519007 Mon Sep 17 00:00:00 2001 From: Jackson Morgan Date: Sun, 4 May 2025 20:48:01 -0400 Subject: [PATCH] Set Up UseLinkQuery structure --- packages/react/src/methods/useLinkQuery.ts | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 packages/react/src/methods/useLinkQuery.ts diff --git a/packages/react/src/methods/useLinkQuery.ts b/packages/react/src/methods/useLinkQuery.ts new file mode 100644 index 0000000..fa92ee1 --- /dev/null +++ b/packages/react/src/methods/useLinkQuery.ts @@ -0,0 +1,27 @@ +import type { ConnectedLdoDataset, ConnectedPlugin } from "@ldo/connected"; +import type { LdoBase } from "@ldo/ldo"; +import type { SubjectNode } from "@ldo/rdf-utils"; +import type { LQInput } from "packages/connected/dist/types/ILinkQuery"; + +/** + * @internal + * + * Creates a useMatchSubject function. + */ +export function createUseQueryLink( + dataset: ConnectedLdoDataset, +) { + /** + * Returns an array of matching linked data objects. Triggers a rerender if + * the data is updated. + */ + return function useQueryLink< + Type extends LdoBase, + QueryInput extends LQInput, + >( + shapeType: ShapeType, + startingResource: string, + startingSubject: SubjectNode | string, + linkQuery: QueryInput, + ): ExpandDeep> | undefined {}; +}