Skip to content

Commit

Permalink
fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed Sep 20, 2024
1 parent 808e667 commit f7ff705
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 321 deletions.
2 changes: 1 addition & 1 deletion packages/store/ts/config/v2/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function resolveEnums<enums extends EnumsInput>(enums: enums): resolveEnu

export type mapEnums<enums> = {
readonly [key in keyof enums]: {
readonly [element in keyof enums[key] as enums[key][element] & string]: parseNumber<element>;
readonly [element in keyof enums[key] & `${number}` as enums[key][element] & string]: parseNumber<element>;
};
};

Expand Down
320 changes: 0 additions & 320 deletions packages/store/ts/config/v2/store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -768,326 +768,6 @@ describe("defineStore", () => {
},
}).type.toString.snap(`{
readonly Example: {
readonly [x: (() => string) & string]: never
readonly [x: (() => string) & string]: never
readonly [
x: {
(
...items: ConcatArray<"First" | "Second">[]
): ("First" | "Second")[]
(
...items: (
| "First"
| "Second"
| ConcatArray<"First" | "Second">
)[]
): ("First" | "Second")[]
} & string
]: never
readonly [
x: ((separator?: string | undefined) => string) &
string
]: never
readonly [
x: ((
start?: number | undefined,
end?: number | undefined
) => ("First" | "Second")[]) &
string
]: never
readonly [
x: ((
searchElement: "First" | "Second",
fromIndex?: number | undefined
) => number) &
string
]: never
readonly [
x: ((
searchElement: "First" | "Second",
fromIndex?: number | undefined
) => number) &
string
]: never
readonly [
x: {
<S extends "First" | "Second">(
predicate: (
value: "First" | "Second",
index: number,
array: readonly ("First" | "Second")[]
) => value is S,
thisArg?: any
): this is readonly S[]
(
predicate: (
value: "First" | "Second",
index: number,
array: readonly ("First" | "Second")[]
) => unknown,
thisArg?: any
): boolean
} & string
]: never
readonly [
x: ((
predicate: (
value: "First" | "Second",
index: number,
array: readonly ("First" | "Second")[]
) => unknown,
thisArg?: any
) => boolean) &
string
]: never
readonly [
x: ((
callbackfn: (
value: "First" | "Second",
index: number,
array: readonly ("First" | "Second")[]
) => void,
thisArg?: any
) => void) &
string
]: never
readonly [
x: (<U>(
callbackfn: (
value: "First" | "Second",
index: number,
array: readonly ("First" | "Second")[]
) => U,
thisArg?: any
) => U[]) &
string
]: never
readonly [
x: {
<S extends "First" | "Second">(
predicate: (
value: "First" | "Second",
index: number,
array: readonly ("First" | "Second")[]
) => value is S,
thisArg?: any
): S[]
(
predicate: (
value: "First" | "Second",
index: number,
array: readonly ("First" | "Second")[]
) => unknown,
thisArg?: any
): ("First" | "Second")[]
} & string
]: never
readonly [
x: {
(
callbackfn: (
previousValue: "First" | "Second",
currentValue: "First" | "Second",
currentIndex: number,
array: readonly ("First" | "Second")[]
) => "First" | "Second"
): "First" | "Second"
(
callbackfn: (
previousValue: "First" | "Second",
currentValue: "First" | "Second",
currentIndex: number,
array: readonly ("First" | "Second")[]
) => "First" | "Second",
initialValue: "First" | "Second"
): "First" | "Second"
<U>(
callbackfn: (
previousValue: U,
currentValue: "First" | "Second",
currentIndex: number,
array: readonly ("First" | "Second")[]
) => U,
initialValue: U
): U
} & string
]: never
readonly [
x: {
(
callbackfn: (
previousValue: "First" | "Second",
currentValue: "First" | "Second",
currentIndex: number,
array: readonly ("First" | "Second")[]
) => "First" | "Second"
): "First" | "Second"
(
callbackfn: (
previousValue: "First" | "Second",
currentValue: "First" | "Second",
currentIndex: number,
array: readonly ("First" | "Second")[]
) => "First" | "Second",
initialValue: "First" | "Second"
): "First" | "Second"
<U>(
callbackfn: (
previousValue: U,
currentValue: "First" | "Second",
currentIndex: number,
array: readonly ("First" | "Second")[]
) => U,
initialValue: U
): U
} & string
]: never
readonly [
x: {
<S extends "First" | "Second">(
predicate: (
value: "First" | "Second",
index: number,
obj: readonly ("First" | "Second")[]
) => value is S,
thisArg?: any
): S | undefined
(
predicate: (
value: "First" | "Second",
index: number,
obj: readonly ("First" | "Second")[]
) => unknown,
thisArg?: any
): "First" | "Second" | undefined
} & string
]: never
readonly [
x: ((
predicate: (
value: "First" | "Second",
index: number,
obj: readonly ("First" | "Second")[]
) => unknown,
thisArg?: any
) => number) &
string
]: never
readonly [
x: (() => IterableIterator<
[number, "First" | "Second"]
>) &
string
]: never
readonly [
x: (() => IterableIterator<number>) & string
]: never
readonly [
x: (() => IterableIterator<"First" | "Second">) &
string
]: never
readonly [
x: ((
searchElement: "First" | "Second",
fromIndex?: number | undefined
) => boolean) &
string
]: never
readonly [
x: (<U, This = undefined>(
callback: (
this: This,
value: "First" | "Second",
index: number,
array: ("First" | "Second")[]
) => U | readonly U[],
thisArg?: This | undefined
) => U[]) &
string
]: never
readonly [
x: (<A, D extends number = 1>(
this: A,
depth?: D | undefined
) => FlatArray<A, D>[]) &
string
]: never
readonly [
x: ((
index: number
) => "First" | "Second" | undefined) &
string
]: never
readonly [
x: {
<S extends "First" | "Second">(
predicate: (
value: "First" | "Second",
index: number,
array: readonly ("First" | "Second")[]
) => value is S,
thisArg?: any
): S | undefined
(
predicate: (
value: "First" | "Second",
index: number,
array: readonly ("First" | "Second")[]
) => unknown,
thisArg?: any
): "First" | "Second" | undefined
} & string
]: never
readonly [
x: ((
predicate: (
value: "First" | "Second",
index: number,
array: readonly ("First" | "Second")[]
) => unknown,
thisArg?: any
) => number) &
string
]: never
readonly [
x: (() => ("First" | "Second")[]) & string
]: never
readonly [
x: ((
compareFn?:
| ((
a: "First" | "Second",
b: "First" | "Second"
) => number)
| undefined
) => ("First" | "Second")[]) &
string
]: never
readonly [
x: {
(
start: number,
deleteCount: number,
...items: ("First" | "Second")[]
): ("First" | "Second")[]
(
start: number,
deleteCount?: number | undefined
): ("First" | "Second")[]
} & string
]: never
readonly [
x: ((
index: number,
value: "First" | "Second"
) => ("First" | "Second")[]) &
string
]: never
readonly [
x: (() => IterableIterator<"First" | "Second">) &
string
]: never
readonly [x: never]: never
readonly First: 0
readonly Second: 1
}
Expand Down

0 comments on commit f7ff705

Please sign in to comment.