Skip to content

Commit 9dd0024

Browse files
prevent reexports
1 parent 97baa1b commit 9dd0024

File tree

3 files changed

+26
-22
lines changed

3 files changed

+26
-22
lines changed

packages/sources/node/src/types/destination.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {
33
Mapping as WalkerOSMapping,
44
WalkerOS,
55
} from '@elbwalker/types';
6-
import type { SourceNode } from '.';
6+
import type { Instance } from './source';
77

88
export interface Destination<Custom = unknown, CustomEvent = unknown>
99
extends WalkerOSDestination.Destination<Custom, CustomEvent> {
@@ -20,7 +20,7 @@ export type DestinationInit = Partial<Omit<Destination, 'push'>> &
2020

2121
export type InitFn<PartialConfig = unknown, Config = unknown> = (
2222
config: PartialConfig,
23-
instance?: SourceNode.Instance,
23+
instance?: Instance,
2424
) => Promise<void | Config | false>;
2525

2626
export type PushFn<Custom, CustomEvent> = (
@@ -41,7 +41,7 @@ export interface EventMapping<CustomEvent = unknown>
4141

4242
export interface Options {
4343
data?: WalkerOSDestination.Data;
44-
instance?: SourceNode.Instance;
44+
instance?: Instance;
4545
}
4646

4747
export type PushEvent<CustomEvent = unknown> =
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import type { Elb, WalkerOS } from '@elbwalker/types';
2-
import { DestinationNode, SourceNode } from '.';
2+
import type { Destination, DestinationInit, Config } from './destination';
3+
import { PushResult as PushResultDest } from './destination';
4+
import { State, Status } from './source';
35

46
export interface Fn<R = Return, D = PushData, O = PushOptions>
57
extends Elb.Fn<R, D, O>,
@@ -8,22 +10,22 @@ export interface Fn<R = Return, D = PushData, O = PushOptions>
810

911
export type CommandDestination<R = void> = (
1012
event: 'walker destination',
11-
destination: DestinationNode.Destination | DestinationNode.DestinationInit,
12-
config?: DestinationNode.Config,
13+
destination: Destination | DestinationInit,
14+
config?: Config,
1315
) => R;
1416
export type CommandRun<R = void> = (event: 'walker run') => R;
1517

1618
export type PushData =
1719
| Elb.PushData
18-
| DestinationNode.Destination
19-
| DestinationNode.DestinationInit
20-
| Partial<SourceNode.State>;
20+
| Destination
21+
| DestinationInit
22+
| Partial<State>;
2123

22-
export type PushOptions = Elb.PushOptions | DestinationNode.Config;
24+
export type PushOptions = Elb.PushOptions | Config;
2325

24-
export interface PushResult extends DestinationNode.PushResult {
26+
export interface PushResult extends PushResultDest {
2527
event?: WalkerOS.Event;
26-
status: SourceNode.Status;
28+
status: Status;
2729
}
2830

2931
export type Return<R = Promise<PushResult>> = R;

packages/sources/node/src/types/source.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
import type { WalkerOS, Schema, Handler, Hooks } from '@elbwalker/types';
2-
import type { DestinationNode, Elb, On } from '.';
2+
import type { Fn, PushData, PushOptions, PushResult } from './elb';
3+
import type { Destination } from './destination';
4+
import type { Config as OnConfig } from './on';
35

46
export interface Instance extends State, WalkerOS.Instance {
57
config: Config;
68
destinations: Destinations;
79
version: string;
8-
push: Elb.Fn;
10+
push: Fn;
911
}
1012

1113
export interface State extends WalkerOS.State {
1214
config: Config;
1315
destinations: Destinations;
14-
on: On.Config;
16+
on: OnConfig;
1517
session: undefined | WalkerOS.SessionData;
1618
timing: number;
1719
}
@@ -30,26 +32,26 @@ export interface InitConfig extends Partial<Config> {
3032
custom?: WalkerOS.Properties;
3133
destinations?: Destinations;
3234
hooks?: Hooks.Functions;
33-
on?: On.Config;
35+
on?: Config;
3436
tagging?: number;
3537
user?: WalkerOS.User;
3638
}
3739

3840
export interface AddDestination {
39-
(id: string, destination: DestinationNode.Destination): void;
41+
(id: string, destination: Destination): void;
4042
}
4143

4244
export type HandleCommand = (
4345
instance: Instance,
4446
action: string,
45-
data?: Elb.PushData,
46-
options?: Elb.PushOptions,
47-
) => Promise<Elb.PushResult>;
47+
data?: PushData,
48+
options?: PushOptions,
49+
) => Promise<PushResult>;
4850

4951
export type HandleEvent = (
5052
instance: Instance,
5153
event: WalkerOS.Event,
52-
) => Promise<Elb.PushResult>;
54+
) => Promise<PushResult>;
5355

5456
export interface Command {
5557
name: string;
@@ -62,7 +64,7 @@ export interface Status {
6264
}
6365

6466
export interface Destinations {
65-
[key: string]: DestinationNode.Destination;
67+
[key: string]: Destination;
6668
}
6769

6870
export type PrependInstance<Fn extends (...args: never) => ReturnType<Fn>> = (

0 commit comments

Comments
 (0)