diff --git a/src/components/StructuredText/index.ts b/src/components/StructuredText/index.ts index edcf476..f399129 100644 --- a/src/components/StructuredText/index.ts +++ b/src/components/StructuredText/index.ts @@ -75,18 +75,27 @@ export function appendKeyToValidElement( return element; } -export type RenderInlineRecordContext = { - record: StructuredTextGraphQlResponseRecord; +export type RenderInlineRecordContext< + R extends + StructuredTextGraphQlResponseRecord = StructuredTextGraphQlResponseRecord, +> = { + record: R; }; -export type RenderRecordLinkContext = { - record: StructuredTextGraphQlResponseRecord; +export type RenderRecordLinkContext< + R extends + StructuredTextGraphQlResponseRecord = StructuredTextGraphQlResponseRecord, +> = { + record: R; children: RenderResult[]; transformedMeta: TransformedMeta; }; -export type RenderBlockContext = { - record: StructuredTextGraphQlResponseRecord; +export type RenderBlockContext< + R extends + StructuredTextGraphQlResponseRecord = StructuredTextGraphQlResponseRecord, +> = { + record: R; }; export const StructuredText = defineComponent({