Skip to content

Commit 545c2c1

Browse files
authored
feat: Add mixin to schema (#91)
* Add $mixin to schema interface * export more types
1 parent d435bfb commit 545c2c1

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

source/types.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,26 +161,31 @@ export interface MutationOptions {
161161
decodeDatesAsIso?: boolean;
162162
}
163163

164-
type SimpleTypeSchemaProperty = {
164+
export type SimpleTypeSchemaProperty = {
165165
type: "string" | "boolean" | "number" | "integer" | "variable";
166166
format?: string;
167167
description?: string;
168168
alias_for?: string;
169169
default?: string;
170170
};
171-
type ArrayTypeSchemaProperty = {
171+
export type ArrayTypeSchemaProperty = {
172172
type: "array" | "mapped_array";
173173
items: RefSchemaProperty;
174174
description?: string;
175175
alias_for?: string;
176176
};
177-
type TypedSchemaProperty = SimpleTypeSchemaProperty | ArrayTypeSchemaProperty;
178-
type RefSchemaProperty = {
177+
export type TypedSchemaProperty =
178+
| SimpleTypeSchemaProperty
179+
| ArrayTypeSchemaProperty;
180+
export type RefSchemaProperty = {
179181
["$ref"]: string;
180182
};
181-
type SchemaProperties = {
183+
export type SchemaProperties = {
182184
[key: string]: TypedSchemaProperty | RefSchemaProperty;
183185
};
186+
export type SchemaMixin = {
187+
$ref: string;
188+
};
184189
export interface Schema {
185190
properties: SchemaProperties;
186191
default_projections: string[];
@@ -192,6 +197,7 @@ export interface Schema {
192197
computed?: string[];
193198
system_projections?: string[];
194199
alias_for?: string | Data;
200+
$mixin?: SchemaMixin;
195201
}
196202
export interface QueryOptions {
197203
abortController?: AbortController;

0 commit comments

Comments
 (0)