(options: {
readonly items: (page: any) => ReadonlyArray<any>
readonly key: (item: any) => string
readonly next: (lastPage: any, allPages: any) => Option.Option<any>
readonly cursor: Schema.Top
})
| 2814 | } |
| 2815 | |
| 2816 | const makeListDef = (options: { |
| 2817 | readonly items: (page: any) => ReadonlyArray<any> |
| 2818 | readonly key: (item: any) => string |
| 2819 | readonly next: (lastPage: any, allPages: any) => Option.Option<any> |
| 2820 | readonly cursor: Schema.Top |
| 2821 | }): ListDef => { |
| 2822 | let encode: ((cursor: unknown) => unknown) | undefined |
| 2823 | return { |
| 2824 | items: options.items, |
| 2825 | key: options.key, |
| 2826 | next: options.next, |
| 2827 | encodeCursor: (cursor) => (encode ??= Schema.encodeUnknownSync(jsonCodec(options.cursor)))(cursor), |
| 2828 | ops: listOps |
| 2829 | } |
| 2830 | } |
| 2831 | |
| 2832 | /** @internal */ |
| 2833 | export const defOf = (query: { readonly [TypeId]: unknown }): QueryDef => query[TypeId] as QueryDef |
no test coverage detected