@sprucelabs/spruce-test-fixtures 52.2.7 → 52.2.9

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.
@@ -711,7 +711,5 @@ function findOrgFromTarget(Class, target) {
711
711
  return match;
712
712
  }
713
713
  async function fakeRegisterListeners() {
714
- await eventFaker_1.default.on('register-listeners::v2020_12_25', () => {
715
- return {};
716
- });
714
+ await eventFaker_1.default.on('register-listeners::v2020_12_25', async () => { });
717
715
  }
@@ -1,17 +1,13 @@
1
- import { SkillEventContract } from '@sprucelabs/mercury-types';
2
- import { SchemaValues } from '@sprucelabs/schema';
3
- /** @ts-ignore */
4
- type Fqen = keyof SkillEventContract['eventSignatures'];
5
- type TargetAndPayload<E extends Fqen> = SchemaValues<
6
- /** @ts-ignore */
7
- SkillEventContract['eventSignatures'][E]['emitPayloadSchema']>;
8
- type Response<E extends Fqen> = SchemaValues<
9
- /** @ts-ignore> */
10
- SkillEventContract['eventSignatures'][E]['responsePayloadSchema']>;
1
+ import { EventNames, EventSignature, SkillEventContract } from '@sprucelabs/mercury-types';
2
+ import { SchemaValues, Schema } from '@sprucelabs/schema';
3
+ type Fqen = EventNames;
4
+ type EmitPayloadSchema<E extends Fqen> = SkillEventContract['eventSignatures'][E]['emitPayloadSchema'];
5
+ type ResponsePayloadSchema<E extends Fqen> = SkillEventContract['eventSignatures'][E] extends EventSignature ? SkillEventContract['eventSignatures'][E]['responsePayloadSchema'] : never;
6
+ type TargetAndPayload<E extends Fqen, S extends Schema | never = EmitPayloadSchema<E> extends Schema ? EmitPayloadSchema<E> : never> = SchemaValues<S>;
7
+ type Response<E extends Fqen> = ResponsePayloadSchema<E> extends Schema ? SchemaValues<ResponsePayloadSchema<E>> : void;
11
8
  declare const eventFaker: {
12
9
  makeEventThrow(fqen: Fqen, error?: any): Promise<void>;
13
10
  handleReactiveEvent(fqen: Fqen): Promise<void>;
14
- /** @ts-ignore */
15
- on<E extends keyof import("@sprucelabs/mercury-types").SkillEventSignatures>(fqen: E, cb: (targetAndPayload: SchemaValues<import("@sprucelabs/mercury-types").SkillEventSignatures[E]["emitPayloadSchema"], false>) => SchemaValues<import("@sprucelabs/mercury-types").SkillEventSignatures[E]["responsePayloadSchema"], false> | Promise<SchemaValues<import("@sprucelabs/mercury-types").SkillEventSignatures[E]["responsePayloadSchema"], false>>): Promise<void>;
11
+ on<E extends Fqen>(fqen: E, cb: (targetAndPayload: SchemaValues<EmitPayloadSchema<E> extends Schema ? EmitPayloadSchema<E> : never, false>) => Response<E> | Promise<Response<E>>): Promise<void>;
16
12
  };
17
13
  export default eventFaker;
@@ -20,7 +20,6 @@ const eventFaker = {
20
20
  const client = getClient(fqen);
21
21
  await client.on(fqen, () => { });
22
22
  },
23
- /** @ts-ignore */
24
23
  async on(fqen, cb) {
25
24
  const client = getClient(fqen);
26
25
  await client.off(fqen);