@interactive-inc/docs-client 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.ts +6 -6
- package/build/index.js +4 -4
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -724,6 +724,10 @@ type GetIndexFieldType<Schema extends DocFileIndexSchema<RecordKey>, K extends k
|
|
|
724
724
|
type GetIndexFieldValueType<Schema extends DocFileIndexSchema<RecordKey>, K extends keyof Schema> = Schema[K] extends {
|
|
725
725
|
type: infer Type;
|
|
726
726
|
} ? Type extends "text" ? DocSchemaFieldTextValue<K> : Type extends "number" ? DocSchemaFieldNumberValue<K> : Type extends "boolean" ? DocSchemaFieldBooleanValue<K> : Type extends "relation" ? DocSchemaFieldRelationValue<K> : Type extends "select-text" ? DocSchemaFieldSelectTextValue<K> : Type extends "select-number" ? DocSchemaFieldSelectNumberValue<K> : Type extends "multi-text" ? DocSchemaFieldMultiTextValue<K> : Type extends "multi-number" ? DocSchemaFieldMultiNumberValue<K> : Type extends "multi-relation" ? DocSchemaFieldMultiRelationValue<K> : Type extends "multi-select-text" ? DocSchemaFieldMultiSelectTextValue<K> : Type extends "multi-select-number" ? DocSchemaFieldMultiSelectNumberValue<K> : never : never;
|
|
727
|
+
/**
|
|
728
|
+
* Infers DocFileMd type from the result of defineSchema
|
|
729
|
+
*/
|
|
730
|
+
type InferDocFileMd<T> = T extends DocCustomSchema ? DocFileMd<T> : never;
|
|
727
731
|
|
|
728
732
|
/**
|
|
729
733
|
* Relation file
|
|
@@ -907,7 +911,7 @@ declare class DocFileIndexMetaValue<T extends DocCustomSchema> {
|
|
|
907
911
|
* Return a new instance with an unknown schema
|
|
908
912
|
* Allows accepting Record<string, unknown> schemas from external sources
|
|
909
913
|
*/
|
|
910
|
-
withUnknownSchema(
|
|
914
|
+
withUnknownSchema(draft: Record<string, unknown>): DocFileIndexMetaValue<DocCustomSchema>;
|
|
911
915
|
/**
|
|
912
916
|
* Output in JSON format
|
|
913
917
|
*/
|
|
@@ -1122,7 +1126,7 @@ declare class DocFileMdMetaValue<T extends DocCustomSchema> {
|
|
|
1122
1126
|
* Return a new instance with an unknown schema
|
|
1123
1127
|
* Allows accepting Record<string, unknown> schemas from external sources
|
|
1124
1128
|
*/
|
|
1125
|
-
withUnknownSchema(
|
|
1129
|
+
withUnknownSchema(draft: Record<string, unknown>): DocFileMdMetaValue<DocCustomSchema>;
|
|
1126
1130
|
schemaField<K extends keyof T>(key: K): T[K];
|
|
1127
1131
|
field<K extends keyof T>(key: K): FieldValueType<ExtractFieldType<T[K]>, ExtractRequired<T[K]>>;
|
|
1128
1132
|
relation(key: keyof T): DocMetaFieldRelation;
|
|
@@ -1856,10 +1860,6 @@ declare const defaultTestConfig: {
|
|
|
1856
1860
|
* type MyDoc = InferDocFileMd<typeof mySchema>
|
|
1857
1861
|
*/
|
|
1858
1862
|
declare function defineSchema<T extends DocCustomSchema>(schema: T): T;
|
|
1859
|
-
/**
|
|
1860
|
-
* Infers DocFileMd type from the result of defineSchema
|
|
1861
|
-
*/
|
|
1862
|
-
type InferDocFileMd<T> = T extends DocCustomSchema ? DocFileMd<T> : never;
|
|
1863
1863
|
/**
|
|
1864
1864
|
* Helper functions for field definitions
|
|
1865
1865
|
* Use when finer control is needed
|
package/build/index.js
CHANGED
|
@@ -1273,8 +1273,8 @@ var DocFileMdMetaValue = class _DocFileMdMetaValue {
|
|
|
1273
1273
|
* Return a new instance with an unknown schema
|
|
1274
1274
|
* Allows accepting Record<string, unknown> schemas from external sources
|
|
1275
1275
|
*/
|
|
1276
|
-
withUnknownSchema(
|
|
1277
|
-
const typedSchema =
|
|
1276
|
+
withUnknownSchema(draft) {
|
|
1277
|
+
const typedSchema = draft;
|
|
1278
1278
|
const newValue = {};
|
|
1279
1279
|
for (const key in typedSchema) {
|
|
1280
1280
|
if (key in this.value) {
|
|
@@ -2876,8 +2876,8 @@ var DocFileIndexMetaValue = class _DocFileIndexMetaValue {
|
|
|
2876
2876
|
* Return a new instance with an unknown schema
|
|
2877
2877
|
* Allows accepting Record<string, unknown> schemas from external sources
|
|
2878
2878
|
*/
|
|
2879
|
-
withUnknownSchema(
|
|
2880
|
-
const typedSchema =
|
|
2879
|
+
withUnknownSchema(draft) {
|
|
2880
|
+
const typedSchema = draft;
|
|
2881
2881
|
return new _DocFileIndexMetaValue(
|
|
2882
2882
|
{
|
|
2883
2883
|
type: "index-meta",
|