diff --git a/package-lock.json b/package-lock.json index fd5dbc1..7f8d30e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@commitlint/cli": "19.5.0", "@commitlint/config-conventional": "19.5.0", "@eslint/js": "9.12.0", - "@stylistic/eslint-plugin": "2.8.0", + "@stylistic/eslint-plugin": "2.9.0", "@types/eslint__js": "8.42.3", "@types/node": "20.16.10", "@types/semver": "7.5.8", @@ -1987,15 +1987,15 @@ } }, "node_modules/@stylistic/eslint-plugin": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-2.8.0.tgz", - "integrity": "sha512-Ufvk7hP+bf+pD35R/QfunF793XlSRIC7USr3/EdgduK9j13i2JjmsM0LUz3/foS+jDYp2fzyWZA9N44CPur0Ow==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-2.9.0.tgz", + "integrity": "sha512-OrDyFAYjBT61122MIY1a3SfEgy3YCMgt2vL4eoPmvTwDBwyQhAXurxNQznlRD/jESNfYWfID8Ej+31LljvF7Xg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/utils": "^8.4.0", - "eslint-visitor-keys": "^4.0.0", - "espree": "^10.1.0", + "@typescript-eslint/utils": "^8.8.0", + "eslint-visitor-keys": "^4.1.0", + "espree": "^10.2.0", "estraverse": "^5.3.0", "picomatch": "^4.0.2" }, diff --git a/package.json b/package.json index c8e818e..6d669cc 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "@commitlint/cli": "19.5.0", "@commitlint/config-conventional": "19.5.0", "@eslint/js": "9.12.0", - "@stylistic/eslint-plugin": "2.8.0", + "@stylistic/eslint-plugin": "2.9.0", "@types/eslint__js": "8.42.3", "@types/node": "20.16.10", "@types/semver": "7.5.8", diff --git a/src/create-actor.ts b/src/create-actor.ts index a6a83d5..801ac52 100644 --- a/src/create-actor.ts +++ b/src/create-actor.ts @@ -23,11 +23,11 @@ export type CreateActorOptions = export type CurryCreateActorFromLogic = (() => CurryCreateActorFromLogic) & (( logic: TLogic, - ) => CurryCreateActorFromLogicP1) & + options: CreateActorOptions, + ) => xs.Actor) & (( logic: TLogic, - options: CreateActorOptions, - ) => xs.Actor); + ) => CurryCreateActorFromLogicP1); export type CurryCreateActorFromLogicP1 = (() => CurryCreateActorFromLogicP1) & @@ -36,11 +36,11 @@ export type CurryCreateActorFromLogicP1 = export type CurryCreateActorWith = (() => CurryCreateActorWith) & (( options: CreateActorOptions, - ) => CurryCreateActorWithP1) & + logic: TLogic, + ) => xs.Actor) & (( options: CreateActorOptions, - logic: TLogic, - ) => xs.Actor); + ) => CurryCreateActorWithP1); export type CurryCreateActorWithP1 = (() => CurryCreateActorWithP1) & diff --git a/src/until-done.ts b/src/until-done.ts index 6b233ed..da7feea 100644 --- a/src/until-done.ts +++ b/src/until-done.ts @@ -25,11 +25,11 @@ export type CurryDoneWith = | (() => CurryDoneWith) | (>( actor: Actor, - ) => CurryDoneWithP1) + options: AuditionOptions, + ) => CurryDoneWithP2) | (>( actor: Actor, - options: AuditionOptions, - ) => CurryDoneWithP2); + ) => CurryDoneWithP1); export type CurryDoneWithP1< Actor extends AnyTerminalActor, diff --git a/src/until-emitted.ts b/src/until-emitted.ts index 5d0e445..81d645d 100644 --- a/src/until-emitted.ts +++ b/src/until-emitted.ts @@ -59,11 +59,11 @@ export type CurryEmittedWith = (() => CurryEmittedWith) & ) => Promise>) & (( actor: TActor, - ) => CurryEmittedWithP1) & + options: AuditionOptions, + ) => CurryEmittedWithP2) & (( actor: TActor, - options: AuditionOptions, - ) => CurryEmittedWithP2); + ) => CurryEmittedWithP1); export type CurryEmittedWithP1 = (() => CurryEmittedWithP1) & diff --git a/src/until-event-received.ts b/src/until-event-received.ts index b46c4ac..c52da51 100644 --- a/src/until-event-received.ts +++ b/src/until-event-received.ts @@ -50,11 +50,11 @@ export type CurryEventReceivedWith = (() => CurryEventReceivedWith) & ) => CurryEventReceivedWithP3) & (( actor: TActor, - ) => CurryEventReceivedWithP1) & + options: AuditionEventOptions, + ) => CurryEventReceivedWithP2) & (( actor: TActor, - options: AuditionEventOptions, - ) => CurryEventReceivedWithP2); + ) => CurryEventReceivedWithP1); export type CurryEventReceivedWithP1 = (() => CurryEventReceivedWithP1) & diff --git a/src/until-event-sent.ts b/src/until-event-sent.ts index c4ae813..9949270 100644 --- a/src/until-event-sent.ts +++ b/src/until-event-sent.ts @@ -17,7 +17,6 @@ import { import {head, isActorRef} from './util.js'; export type CurryEventSent = (() => CurryEventSent) & - ((actor: Actor) => CurryEventSentP1) & (< TActor extends AnyActor, TReceiver extends AnyEventReceiverActor = AnyEventReceiverActor, @@ -26,7 +25,8 @@ export type CurryEventSent = (() => CurryEventSent) & >( actor: TActor, eventTypes: TEventTypes, - ) => CurryEventSentP2); + ) => CurryEventSentP2) & + ((actor: Actor) => CurryEventSentP1); export type CurryEventSentP1< TActor extends AnyActor, @@ -49,20 +49,20 @@ export type CurryEventSentWith = (() => CurryEventSentWith) & (< TActor extends AnyActor, TReceiver extends AnyEventReceiverActor = AnyEventReceiverActor, + const TEventTypes extends + ActorEventTypeTuple = ActorEventTypeTuple, >( actor: TActor, options: AuditionEventOptions, - ) => CurryEventSentWithP2) & + eventTypes: TEventTypes, + ) => CurryEventSentWithP3) & (< TActor extends AnyActor, TReceiver extends AnyEventReceiverActor = AnyEventReceiverActor, - const TEventTypes extends - ActorEventTypeTuple = ActorEventTypeTuple, >( actor: TActor, options: AuditionEventOptions, - eventTypes: TEventTypes, - ) => CurryEventSentWithP3) & + ) => CurryEventSentWithP2) & ((actor: TActor) => CurryEventSentWithP1); export type CurryEventSentWithP1 = diff --git a/src/until-snapshot.ts b/src/until-snapshot.ts index b842b77..5d65db8 100644 --- a/src/until-snapshot.ts +++ b/src/until-snapshot.ts @@ -12,17 +12,16 @@ import { export type CurrySnapshot = (() => CurrySnapshot) & (( actor: TActor, - ) => CurrySnapshotP1) & + predicate: SnapshotPredicate, + ) => CurrySnapshotP2) & (( actor: TActor, - predicate: SnapshotPredicate, - ) => CurrySnapshotP2); + ) => CurrySnapshotP1); -export type CurrySnapshotP1 = - (() => CurrySnapshotP1) & - (( - predicate: SnapshotPredicate, - ) => CurrySnapshotP2); +export type CurrySnapshotP1 = (( + predicate: SnapshotPredicate, +) => CurrySnapshotP2) & + (() => CurrySnapshotP1); export type CurrySnapshotP2 = Promise< xs.SnapshotFrom @@ -31,26 +30,26 @@ export type CurrySnapshotP2 = Promise< export type CurrySnapshotWith = (() => CurrySnapshotWith) & (( actor: TActor, - ) => CurrySnapshotWithP1) & + predicate: SnapshotPredicate, + options: AuditionOptions, + ) => CurrySnapshotWithP3) & (( actor: TActor, predicate: SnapshotPredicate, ) => CurrySnapshotWithP2) & (( actor: TActor, - predicate: SnapshotPredicate, - options: AuditionOptions, - ) => CurrySnapshotWithP3); + ) => CurrySnapshotWithP1); // prettier-ignore -export type CurrySnapshotWithP1 = (() => CurrySnapshotWithP1) & - (( +export type CurrySnapshotWithP1 = (( predicate: SnapshotPredicate, ) => CurrySnapshotWithP2) & (( predicate: SnapshotPredicate, options: AuditionOptions, -) => CurrySnapshotWithP3); +) => CurrySnapshotWithP3) & + (() => CurrySnapshotWithP1); export type CurrySnapshotWithP2 = (() => CurrySnapshotWithP2) & diff --git a/src/until-spawn.ts b/src/until-spawn.ts index bc2953d..6e9f996 100644 --- a/src/until-spawn.ts +++ b/src/until-spawn.ts @@ -16,11 +16,11 @@ export type SpawnTarget = RegExp | string; export type CurrySpawn = (() => CurrySpawn) & (( actor: AnyStateMachineActor, - ) => CurrySpawnP1) & + target: SpawnTarget, + ) => CurrySpawnP2) & (( actor: AnyStateMachineActor, - target: SpawnTarget, - ) => CurrySpawnP2); + ) => CurrySpawnP1); export type CurrySpawnP1 = (() => CurrySpawnP1) & @@ -33,24 +33,23 @@ export type CurrySpawnP2 = Promise< export type CurrySpawnWith = (() => CurrySpawnWith) & (( actor: AnyStateMachineActor, - ) => CurrySpawnWithP1) & + options: AuditionOptions, + target: SpawnTarget, + ) => CurrySpawnWithP3) & (( actor: AnyStateMachineActor, options: AuditionOptions, ) => CurrySpawnWithP2) & (( actor: AnyStateMachineActor, - options: AuditionOptions, - target: SpawnTarget, - ) => CurrySpawnWithP3); + ) => CurrySpawnWithP1); -export type CurrySpawnWithP1 = +export type CurrySpawnWithP1 = (( + options: AuditionOptions, + target: SpawnTarget, +) => CurrySpawnWithP3) & (() => CurrySpawnWithP1) & - ((options: AuditionOptions) => CurrySpawnWithP2) & - (( - options: AuditionOptions, - target: SpawnTarget, - ) => CurrySpawnWithP3); + ((options: AuditionOptions) => CurrySpawnWithP2); export type CurrySpawnWithP2 = (() => CurrySpawnWithP2) & diff --git a/src/until-transition.ts b/src/until-transition.ts index 359e48a..e1a3ae4 100644 --- a/src/until-transition.ts +++ b/src/until-transition.ts @@ -22,16 +22,16 @@ import { export type CurryTransition = (() => CurryTransition) & (( actor: TActor, - ) => CurryTransitionP1) & + source: string, + target: string, + ) => CurryTransitionP3) & (( actor: TActor, source: string, ) => CurryTransitionP2) & (( actor: TActor, - source: string, - target: string, - ) => CurryTransitionP3); + ) => CurryTransitionP1); export type CurryTransitionP1 = (() => CurryTransitionP1) & @@ -58,13 +58,12 @@ export type CurryTransitionP2 = export type CurryTransitionP3 = Promise; export type CurryTransitionWith = (() => CurryTransitionWith) & - (( - actor: TActor, - ) => CurryTransitionWithP1) & (( actor: TActor, options: AuditionOptions, - ) => CurryTransitionWithP2) & + source: string, + target: string, + ) => CurryTransitionWithP4) & (( actor: TActor, options: AuditionOptions, @@ -73,31 +72,32 @@ export type CurryTransitionWith = (() => CurryTransitionWith) & (( actor: TActor, options: AuditionOptions, - source: string, - target: string, - ) => CurryTransitionWithP4); + ) => CurryTransitionWithP2) & + (( + actor: TActor, + ) => CurryTransitionWithP1); // conflict with eslint-plugin-perfectionist // prettier-ignore export type CurryTransitionWithP1 = - & (() => CurryTransitionWithP1) - & ((options: AuditionOptions) => CurryTransitionWithP2) - & ((options: AuditionOptions, source: string) => CurryTransitionWithP3) & (( options: AuditionOptions, source: string, target: string, - ) => CurryTransitionWithP4); + ) => CurryTransitionWithP4) + & (() => CurryTransitionWithP1) + & ((options: AuditionOptions) => CurryTransitionWithP2) + & ((options: AuditionOptions, source: string) => CurryTransitionWithP3); // conflict with eslint-plugin-perfectionist // prettier-ignore export type CurryTransitionWithP2 = - & (() => CurryTransitionWithP2) - & ((source: string) => CurryTransitionWithP3) & (( source: string, target: string, - ) => CurryTransitionWithP4); + ) => CurryTransitionWithP4) + & (() => CurryTransitionWithP2) + & ((source: string) => CurryTransitionWithP3); export type CurryTransitionWithP3 = (() => CurryTransitionWithP3) &