12 lines
602 B
TypeScript
12 lines
602 B
TypeScript
import { encodeQxValue, decodeQxValue, type MessageBinding, type QxValueType } from "@quixos/camino-package-runtime";
|
|||
|
|
|
||
|
|
type SearchDocument = { title: string; subtitle: string; keywords: string[] };
|
||
|
|
const schema: QxValueType = { kind: "record", fields: {
|
||
|
|
title: { kind: "scalar", name: "string" }, subtitle: { kind: "scalar", name: "string" },
|
||
|
|
keywords: { kind: "list", value: { kind: "scalar", name: "string" } },
|
||
|
|
}};
|
||
|
|
export const searchDocumentBinding: MessageBinding<SearchDocument> = {
|
||
|
|
encode: value => encodeQxValue(schema, value, {}),
|
||
|
|
decode: value => decodeQxValue(schema, value, {}),
|
||
|
|
};
|