yanki 2.0.9 → 2.0.11
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/dist/bin/cli.js +144 -145
- package/dist/lib/index.d.ts +8 -6
- package/dist/lib/index.js +402 -347
- package/dist/standalone/index.d.ts +103 -75
- package/dist/standalone/index.js +155 -155
- package/package.json +25 -25
- package/readme.md +6 -2
- /package/dist/bin/{open-CC1xuL9n.js → open-PkGTdlsi.js} +0 -0
- /package/dist/standalone/{open-DsJJlGt1.js → open-DnUwqK4E.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
1
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/primitive.d.ts
|
|
2
2
|
/**
|
|
3
3
|
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/
|
|
|
6
6
|
*/
|
|
7
7
|
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
8
8
|
//#endregion
|
|
9
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
9
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/is-any.d.ts
|
|
10
10
|
/**
|
|
11
11
|
Returns a boolean for whether the given type is `any`.
|
|
12
12
|
|
|
@@ -37,7 +37,7 @@ const anyA = get(anyObject, 'a');
|
|
|
37
37
|
*/
|
|
38
38
|
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
39
39
|
//#endregion
|
|
40
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
40
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/is-optional-key-of.d.ts
|
|
41
41
|
/**
|
|
42
42
|
Returns a boolean for whether the given key is an optional key of type.
|
|
43
43
|
|
|
@@ -80,7 +80,7 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
|
|
|
80
80
|
*/
|
|
81
81
|
type IsOptionalKeyOf<Type extends object, Key extends keyof Type> = IsAny<Type | Key> extends true ? never : Key extends keyof Type ? Type extends Record<Key, Type[Key]> ? false : true : false;
|
|
82
82
|
//#endregion
|
|
83
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
83
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/optional-keys-of.d.ts
|
|
84
84
|
/**
|
|
85
85
|
Extract all optional keys from the given type.
|
|
86
86
|
|
|
@@ -115,10 +115,10 @@ const update2: UpdateOperation<User> = {
|
|
|
115
115
|
@category Utilities
|
|
116
116
|
*/
|
|
117
117
|
type OptionalKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
118
|
-
? (keyof { [Key in keyof Type as IsOptionalKeyOf<Type, Key> extends false ? never : Key]: never }) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
|
|
119
|
-
: never;
|
|
118
|
+
? (keyof { [Key in keyof Type as IsOptionalKeyOf<Type, Key> extends false ? never : Key]: never; }) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
|
|
119
|
+
: never; // Should never happen
|
|
120
120
|
//#endregion
|
|
121
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
121
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/required-keys-of.d.ts
|
|
122
122
|
/**
|
|
123
123
|
Extract all required keys from the given type.
|
|
124
124
|
|
|
@@ -150,9 +150,9 @@ const validator3 = createValidation<User>('luckyNumber', value => value > 0);
|
|
|
150
150
|
@category Utilities
|
|
151
151
|
*/
|
|
152
152
|
type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
153
|
-
? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
|
|
153
|
+
? Exclude<keyof Type, OptionalKeysOf<Type>> : never; // Should never happen
|
|
154
154
|
//#endregion
|
|
155
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
155
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/is-never.d.ts
|
|
156
156
|
/**
|
|
157
157
|
Returns a boolean for whether the given type is `never`.
|
|
158
158
|
|
|
@@ -208,7 +208,7 @@ type B = IsTrueFixed<never>;
|
|
|
208
208
|
*/
|
|
209
209
|
type IsNever<T> = [T] extends [never] ? true : false;
|
|
210
210
|
//#endregion
|
|
211
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
211
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/if.d.ts
|
|
212
212
|
/**
|
|
213
213
|
An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
214
214
|
|
|
@@ -303,7 +303,7 @@ type Works = IncludesWithoutIf<HundredZeroes, '1'>;
|
|
|
303
303
|
*/
|
|
304
304
|
type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
|
|
305
305
|
//#endregion
|
|
306
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
306
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/internal/type.d.ts
|
|
307
307
|
/**
|
|
308
308
|
Matches any primitive, `void`, `Date`, or `RegExp` value.
|
|
309
309
|
*/
|
|
@@ -321,7 +321,7 @@ type HasMultipleCallSignatures<T extends (...arguments_: any[]) => unknown> = T
|
|
|
321
321
|
(...arguments_: infer B): unknown;
|
|
322
322
|
} ? B extends A ? A extends B ? false : true : true : false;
|
|
323
323
|
//#endregion
|
|
324
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
324
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/simplify.d.ts
|
|
325
325
|
/**
|
|
326
326
|
Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
|
|
327
327
|
|
|
@@ -380,9 +380,9 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
380
380
|
@see {@link SimplifyDeep}
|
|
381
381
|
@category Object
|
|
382
382
|
*/
|
|
383
|
-
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
383
|
+
type Simplify<T> = { [KeyType in keyof T]: T[KeyType]; } & {};
|
|
384
384
|
//#endregion
|
|
385
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
385
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/is-equal.d.ts
|
|
386
386
|
/**
|
|
387
387
|
Returns a boolean for whether the two given types are equal.
|
|
388
388
|
|
|
@@ -413,7 +413,7 @@ type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false
|
|
|
413
413
|
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
414
414
|
type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
415
415
|
//#endregion
|
|
416
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
416
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/omit-index-signature.d.ts
|
|
417
417
|
/**
|
|
418
418
|
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
419
419
|
|
|
@@ -505,9 +505,9 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
505
505
|
@see {@link PickIndexSignature}
|
|
506
506
|
@category Object
|
|
507
507
|
*/
|
|
508
|
-
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
508
|
+
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType]; };
|
|
509
509
|
//#endregion
|
|
510
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
510
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/pick-index-signature.d.ts
|
|
511
511
|
/**
|
|
512
512
|
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
513
513
|
|
|
@@ -553,11 +553,11 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
553
553
|
@see {@link OmitIndexSignature}
|
|
554
554
|
@category Object
|
|
555
555
|
*/
|
|
556
|
-
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
556
|
+
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType]; };
|
|
557
557
|
//#endregion
|
|
558
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
558
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/merge.d.ts
|
|
559
559
|
// Merges two objects without worrying about index signatures.
|
|
560
|
-
type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source>;
|
|
560
|
+
type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key]; } & Source>;
|
|
561
561
|
/**
|
|
562
562
|
Merge two types into a new type. Keys of the second type overrides keys of the first type.
|
|
563
563
|
|
|
@@ -621,13 +621,12 @@ Note: If you want a merge type that more accurately reflects the runtime behavio
|
|
|
621
621
|
@category Object
|
|
622
622
|
*/
|
|
623
623
|
type Merge<Destination, Source> = Destination extends unknown // For distributing `Destination`
|
|
624
|
-
? Source extends unknown // For distributing `Source`
|
|
625
|
-
? If<IsEqual<Destination, Source>, Destination, _Merge<Destination, Source>> : never // Should never happen
|
|
626
|
-
: never;
|
|
627
|
-
// Should never happen
|
|
624
|
+
? Source extends unknown // For distributing `Source`
|
|
625
|
+
? If<IsEqual<Destination, Source>, Destination, _Merge<Destination, Source>> : never // Should never happen
|
|
626
|
+
: never; // Should never happen
|
|
628
627
|
type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
629
628
|
//#endregion
|
|
630
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
629
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/internal/object.d.ts
|
|
631
630
|
/**
|
|
632
631
|
Merges user specified options with default options.
|
|
633
632
|
|
|
@@ -680,34 +679,44 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
|
|
|
680
679
|
// Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
|
|
681
680
|
```
|
|
682
681
|
*/
|
|
683
|
-
type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> =
|
|
682
|
+
type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> = _ApplyDefaultOptions<Options, Defaults, SpecifiedOptions> extends (infer Result extends Required<Options> // `extends Required<Options>` ensures that `ApplyDefaultOptions<SomeOption, ...>` is always assignable to `Required<SomeOption>`
|
|
683
|
+
) ? Result : never;
|
|
684
|
+
type _ApplyDefaultOptions<Options, Defaults, SpecifiedOptions> = If<IsAny<SpecifiedOptions>, Defaults, If<IsNever<SpecifiedOptions>, Defaults, Merge<Defaults, { [Key in keyof SpecifiedOptions as undefined extends Required<Options>[Key & keyof Options] ? Key : undefined extends SpecifiedOptions[Key] ? never : Key]: SpecifiedOptions[Key]; }>>>;
|
|
684
685
|
//#endregion
|
|
685
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
686
|
+
//#region node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/partial-deep.d.ts
|
|
686
687
|
/**
|
|
687
688
|
@see {@link PartialDeep}
|
|
688
689
|
*/
|
|
689
690
|
type PartialDeepOptions = {
|
|
690
691
|
/**
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
692
|
+
Whether to affect the individual elements of arrays and tuples.
|
|
693
|
+
|
|
694
|
+
@default false
|
|
695
|
+
*/
|
|
694
696
|
readonly recurseIntoArrays?: boolean;
|
|
695
697
|
/**
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
698
|
+
Allows `undefined` values in non-tuple arrays.
|
|
699
|
+
|
|
700
|
+
- When set to `true`, elements of non-tuple arrays can be `undefined`.
|
|
701
|
+
- When set to `false`, only explicitly defined elements are allowed in non-tuple arrays, ensuring stricter type checking.
|
|
702
|
+
|
|
703
|
+
@default false
|
|
704
|
+
|
|
705
|
+
@example
|
|
706
|
+
You can allow `undefined` values in non-tuple arrays by passing `{recurseIntoArrays: true; allowUndefinedInNonTupleArrays: true}` as the second type argument:
|
|
707
|
+
|
|
708
|
+
```
|
|
709
|
+
import type {PartialDeep} from 'type-fest';
|
|
710
|
+
|
|
711
|
+
type Settings = {
|
|
712
|
+
languages: string[];
|
|
713
|
+
};
|
|
714
|
+
|
|
715
|
+
declare const partialSettings: PartialDeep<Settings, {recurseIntoArrays: true; allowUndefinedInNonTupleArrays: true}>;
|
|
716
|
+
|
|
717
|
+
partialSettings.languages = [undefined]; // OK
|
|
718
|
+
```
|
|
719
|
+
*/
|
|
711
720
|
readonly allowUndefinedInNonTupleArrays?: boolean;
|
|
712
721
|
};
|
|
713
722
|
type DefaultPartialDeepOptions = {
|
|
@@ -769,12 +778,12 @@ partialShape.dimensions = [15]; // OK
|
|
|
769
778
|
*/
|
|
770
779
|
type PartialDeep<T, Options extends PartialDeepOptions = {}> = _PartialDeep<T, ApplyDefaultOptions<PartialDeepOptions, DefaultPartialDeepOptions, Options>>;
|
|
771
780
|
type _PartialDeep<T, Options extends Required<PartialDeepOptions>> = T extends BuiltIns | ((new (...arguments_: any[]) => unknown)) ? T : T extends Map<infer KeyType, infer ValueType> ? PartialMapDeep<KeyType, ValueType, Options> : T extends Set<infer ItemType> ? PartialSetDeep<ItemType, Options> : T extends ReadonlyMap<infer KeyType, infer ValueType> ? PartialReadonlyMapDeep<KeyType, ValueType, Options> : T extends ReadonlySet<infer ItemType> ? PartialReadonlySetDeep<ItemType, Options> : T extends ((...arguments_: any[]) => unknown) ? IsNever<keyof T> extends true ? T // For functions with no properties
|
|
772
|
-
: HasMultipleCallSignatures<T> extends true ? T : ((...arguments_: Parameters<T>) => ReturnType<T>) & PartialObjectDeep<T, Options> : T extends object ? T extends ReadonlyArray<infer ItemType> // Test for arrays/tuples, per https://github.com/microsoft/TypeScript/issues/35156
|
|
773
|
-
? Options['recurseIntoArrays'] extends true ? ItemType[] extends T // Test for arrays (non-tuples) specifically
|
|
774
|
-
? readonly ItemType[] extends T // Differentiate readonly and mutable arrays
|
|
775
|
-
? ReadonlyArray<_PartialDeep<Options['allowUndefinedInNonTupleArrays'] extends false ? ItemType : ItemType | undefined, Options>> : Array<_PartialDeep<Options['allowUndefinedInNonTupleArrays'] extends false ? ItemType : ItemType | undefined, Options>> : PartialObjectDeep<T, Options> // Tuples behave properly
|
|
776
|
-
: T // If they don't opt into array testing, just use the original type
|
|
777
|
-
: PartialObjectDeep<T, Options> : unknown;
|
|
781
|
+
: HasMultipleCallSignatures<T> extends true ? T : ((...arguments_: Parameters<T>) => ReturnType<T>) & PartialObjectDeep<T, Options> : T extends object ? T extends ReadonlyArray<infer ItemType> // Test for arrays/tuples, per https://github.com/microsoft/TypeScript/issues/35156
|
|
782
|
+
? Options['recurseIntoArrays'] extends true ? ItemType[] extends T // Test for arrays (non-tuples) specifically
|
|
783
|
+
? readonly ItemType[] extends T // Differentiate readonly and mutable arrays
|
|
784
|
+
? ReadonlyArray<_PartialDeep<Options['allowUndefinedInNonTupleArrays'] extends false ? ItemType : ItemType | undefined, Options>> : Array<_PartialDeep<Options['allowUndefinedInNonTupleArrays'] extends false ? ItemType : ItemType | undefined, Options>> : PartialObjectDeep<T, Options> // Tuples behave properly
|
|
785
|
+
: T // If they don't opt into array testing, just use the original type
|
|
786
|
+
: PartialObjectDeep<T, Options> : unknown;
|
|
778
787
|
/**
|
|
779
788
|
Same as `PartialDeep`, but accepts only `Map`s and as inputs. Internal helper for `PartialDeep`.
|
|
780
789
|
*/
|
|
@@ -794,9 +803,9 @@ type PartialReadonlySetDeep<T, Options extends Required<PartialDeepOptions>> = {
|
|
|
794
803
|
/**
|
|
795
804
|
Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for `PartialDeep`.
|
|
796
805
|
*/
|
|
797
|
-
type PartialObjectDeep<ObjectType extends object, Options extends Required<PartialDeepOptions>> = { [KeyType in keyof ObjectType]?: _PartialDeep<ObjectType[KeyType], Options
|
|
806
|
+
type PartialObjectDeep<ObjectType extends object, Options extends Required<PartialDeepOptions>> = { [KeyType in keyof ObjectType]?: _PartialDeep<ObjectType[KeyType], Options>; };
|
|
798
807
|
//#endregion
|
|
799
|
-
//#region node_modules/.pnpm/yanki-connect@4.0.
|
|
808
|
+
//#region node_modules/.pnpm/yanki-connect@4.0.7/node_modules/yanki-connect/dist/index.d.ts
|
|
800
809
|
//#region src/types/deck.d.ts
|
|
801
810
|
type DeckStats = {
|
|
802
811
|
deck_id: number;
|
|
@@ -864,7 +873,8 @@ type DeckRequests = Request<'changeDeck', 6, {
|
|
|
864
873
|
}, boolean> | Request<'setDeckConfigId', 6, {
|
|
865
874
|
configId: number;
|
|
866
875
|
decks: string[];
|
|
867
|
-
}, boolean>;
|
|
876
|
+
}, boolean>;
|
|
877
|
+
//#endregion
|
|
868
878
|
//#region src/types/note.d.ts
|
|
869
879
|
type NoteModel = 'Basic' | 'Basic (and reversed card)' | 'Basic (type in the answer)' | 'Cloze' | (string & {});
|
|
870
880
|
type NoteMedia = {
|
|
@@ -976,7 +986,8 @@ type NoteRequests = Request<'addNote', 6, {
|
|
|
976
986
|
}> | Request<'updateNoteTags', 6, {
|
|
977
987
|
note: number;
|
|
978
988
|
tags: string[];
|
|
979
|
-
}>;
|
|
989
|
+
}>;
|
|
990
|
+
//#endregion
|
|
980
991
|
//#region src/types/graphical.d.ts
|
|
981
992
|
type GraphicalRequests = Request<'guiAddCards', 6, {
|
|
982
993
|
note: Note;
|
|
@@ -1000,7 +1011,8 @@ type GraphicalRequests = Request<'guiAddCards', 6, {
|
|
|
1000
1011
|
card: number;
|
|
1001
1012
|
}, boolean> | Request<'guiSelectedNotes', 6, never, number[]> | Request<'guiSelectNote', 6, {
|
|
1002
1013
|
note: number;
|
|
1003
|
-
}, boolean> | Request<'guiShowAnswer', 6, never, boolean> | Request<'guiShowQuestion', 6, never, boolean> | Request<'guiStartCardTimer', 6, never, true> | Request<'guiUndo', 6, never, boolean>;
|
|
1014
|
+
}, boolean> | Request<'guiShowAnswer', 6, never, boolean> | Request<'guiShowQuestion', 6, never, boolean> | Request<'guiStartCardTimer', 6, never, true> | Request<'guiUndo', 6, never, boolean>;
|
|
1015
|
+
//#endregion
|
|
1004
1016
|
//#region src/types/media.d.ts
|
|
1005
1017
|
type MediaRequests = Request<'deleteMediaFile', 6, {
|
|
1006
1018
|
filename: string;
|
|
@@ -1014,7 +1026,8 @@ type MediaRequests = Request<'deleteMediaFile', 6, {
|
|
|
1014
1026
|
filename: string;
|
|
1015
1027
|
path?: string;
|
|
1016
1028
|
url?: string;
|
|
1017
|
-
}, string>;
|
|
1029
|
+
}, string>;
|
|
1030
|
+
//#endregion
|
|
1018
1031
|
//#region src/types/miscellaneous.d.ts
|
|
1019
1032
|
type MiscellaneousRequests = Request<'apiReflect', 6, {
|
|
1020
1033
|
actions: null | string[];
|
|
@@ -1030,8 +1043,8 @@ type MiscellaneousRequests = Request<'apiReflect', 6, {
|
|
|
1030
1043
|
path: string;
|
|
1031
1044
|
}, boolean> | Request<'loadProfile', 6, {
|
|
1032
1045
|
name: string;
|
|
1033
|
-
}, true> | Request<'multi', 6
|
|
1034
|
-
{
|
|
1046
|
+
}, true> | Request<'multi', 6 // Crazy, have to call this experimental
|
|
1047
|
+
, {
|
|
1035
1048
|
actions: Array<{
|
|
1036
1049
|
action: Requests['action'];
|
|
1037
1050
|
params?: Requests['params'];
|
|
@@ -1046,7 +1059,8 @@ type MiscellaneousRequests = Request<'apiReflect', 6, {
|
|
|
1046
1059
|
permission: 'granted';
|
|
1047
1060
|
requireApiKey: boolean;
|
|
1048
1061
|
version: boolean;
|
|
1049
|
-
}> | Request<'sync', 6> | Request<'version', 6, never, number>;
|
|
1062
|
+
}> | Request<'sync', 6> | Request<'version', 6, never, number>;
|
|
1063
|
+
//#endregion
|
|
1050
1064
|
//#region src/types/model.d.ts
|
|
1051
1065
|
type ModelField = {
|
|
1052
1066
|
collapsed: boolean;
|
|
@@ -1197,7 +1211,8 @@ type ModelRequests = Request<'createModel', 6, ModelToCreate, Model> | Request<'
|
|
|
1197
1211
|
Front?: string;
|
|
1198
1212
|
}>;
|
|
1199
1213
|
};
|
|
1200
|
-
}>;
|
|
1214
|
+
}>;
|
|
1215
|
+
//#endregion
|
|
1201
1216
|
//#region src/types/statistic.d.ts
|
|
1202
1217
|
type ReviewStatisticTuple = [reviewTime: number, cardID: number, usn: number, buttonPressed: number, newInterval: number, previousInterval: number, newFactor: number, reviewDuration: number, reviewType: number];
|
|
1203
1218
|
type StatisticRequests = Request<'cardReviews', 6, {
|
|
@@ -1210,17 +1225,26 @@ type StatisticRequests = Request<'cardReviews', 6, {
|
|
|
1210
1225
|
}, number> | Request<'getNumCardsReviewedByDay', 6, never, Array<[string, number]>> | Request<'getNumCardsReviewedToday', 6, never, number> | Request<'getReviewsOfCards', 6, {
|
|
1211
1226
|
cards: string[];
|
|
1212
1227
|
}, Record<string, Array<{
|
|
1213
|
-
/** ButtonPressed */
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1228
|
+
/** ButtonPressed */
|
|
1229
|
+
ease: number;
|
|
1230
|
+
/** NewFactor */
|
|
1231
|
+
factor: number;
|
|
1232
|
+
/** ReviewTime */
|
|
1233
|
+
id: number;
|
|
1234
|
+
/** NewInterval */
|
|
1235
|
+
ivl: number;
|
|
1236
|
+
/** PreviousInterval */
|
|
1237
|
+
lastIvl: number;
|
|
1238
|
+
/** ReviewDuration */
|
|
1239
|
+
time: number;
|
|
1240
|
+
/** ReviewType */
|
|
1241
|
+
type: number;
|
|
1242
|
+
/** Usn */
|
|
1220
1243
|
usn: number;
|
|
1221
1244
|
}>>> | Request<'insertReviews', 6, {
|
|
1222
1245
|
reviews: ReviewStatisticTuple[];
|
|
1223
|
-
}>;
|
|
1246
|
+
}>;
|
|
1247
|
+
//#endregion
|
|
1224
1248
|
//#region src/types/shared.d.ts
|
|
1225
1249
|
/**
|
|
1226
1250
|
* Abstract wrapper over an Anki Connect action / response
|
|
@@ -1317,7 +1341,8 @@ type CardRequests = Request<'answerCards', 6, {
|
|
|
1317
1341
|
card: number;
|
|
1318
1342
|
}, boolean> | Request<'unsuspend', 6, {
|
|
1319
1343
|
cards: number[];
|
|
1320
|
-
}, boolean>;
|
|
1344
|
+
}, boolean>;
|
|
1345
|
+
//#endregion
|
|
1321
1346
|
//#region src/client.d.ts
|
|
1322
1347
|
/**
|
|
1323
1348
|
* Subset of built-in Fetch interface that's actually used by Anki, for ease of
|
|
@@ -1504,8 +1529,10 @@ type GlobalOptions = {
|
|
|
1504
1529
|
* user-specified file names in other cases.
|
|
1505
1530
|
*/
|
|
1506
1531
|
maxFilenameLength: number;
|
|
1507
|
-
namespace: string;
|
|
1508
|
-
|
|
1532
|
+
namespace: string;
|
|
1533
|
+
/** Ensures that wiki-style links work correctly */
|
|
1534
|
+
obsidianVault: string | undefined;
|
|
1535
|
+
/** Exposed for testing only */
|
|
1509
1536
|
resolveUrls: boolean;
|
|
1510
1537
|
/**
|
|
1511
1538
|
* Whether to treat single newlines in Markdown as line breaks in the
|
|
@@ -1517,7 +1544,8 @@ type GlobalOptions = {
|
|
|
1517
1544
|
* be equivalent, don't match local notes with "orphaned" remote notes based
|
|
1518
1545
|
* on content
|
|
1519
1546
|
*/
|
|
1520
|
-
strictMatching: boolean;
|
|
1547
|
+
strictMatching: boolean;
|
|
1548
|
+
/** Sync image, video, and audio assets to Anki's media storage system */
|
|
1521
1549
|
syncMediaAssets: SyncMediaAssets;
|
|
1522
1550
|
};
|
|
1523
1551
|
//#endregion
|
|
@@ -1566,12 +1594,12 @@ type LocalNote = {
|
|
|
1566
1594
|
};
|
|
1567
1595
|
//#endregion
|
|
1568
1596
|
//#region src/lib/actions/rename.d.ts
|
|
1569
|
-
type RenameNotesOptions = Pick<GlobalOptions, 'dryRun' | 'fileAdapter' | 'manageFilenames' | 'maxFilenameLength'
|
|
1597
|
+
type RenameNotesOptions = Pick<GlobalOptions, 'dryRun' | 'fileAdapter' | 'manageFilenames' | 'maxFilenameLength' |
|
|
1570
1598
|
/**
|
|
1571
1599
|
* Included because this can technically change the content of the "first
|
|
1572
1600
|
* line" of a card
|
|
1573
1601
|
*/
|
|
1574
|
-
|
|
1602
|
+
'strictLineBreaks'>;
|
|
1575
1603
|
type RenameFilesResult = {
|
|
1576
1604
|
dryRun: boolean;
|
|
1577
1605
|
notes: LocalNote[];
|