Skip to content

Commit 816f06b

Browse files
authored
fix(engine-core): export wire types used in WireAdapter (salesforce#1951)
1 parent c5f5581 commit 816f06b

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

packages/@lwc/engine-core/src/framework/main.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,11 @@ export { getComponentDef, isComponentConstructor } from './def';
3939

4040
// Types -------------------------------------------------------------------------------------------
4141
export type { Renderer } from './renderer';
42-
export type { DataCallback, WireAdapter, WireAdapterConstructor } from './wiring';
42+
export type {
43+
ConfigValue as WireConfigValue,
44+
ContextValue as WireContextValue,
45+
DataCallback,
46+
WireAdapter,
47+
WireAdapterConstructor,
48+
WireAdapterSchemaValue,
49+
} from './wiring';

packages/@lwc/engine-core/src/framework/wiring.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,15 +217,15 @@ function createConnector(vm: VM, name: string, wireDef: WireDef): WireAdapter {
217217
}
218218

219219
export type DataCallback = (value: any) => void;
220-
type ConfigValue = Record<string, any>;
220+
export type ConfigValue = Record<string, any>;
221221

222222
export interface WireAdapter {
223223
update(config: ConfigValue, context?: ContextValue): void;
224224
connect(): void;
225225
disconnect(): void;
226226
}
227227

228-
type WireAdapterSchemaValue = 'optional' | 'required';
228+
export type WireAdapterSchemaValue = 'optional' | 'required';
229229

230230
interface WireDef {
231231
method?: (data: any) => void;

packages/@lwc/wire-service/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
66
*/
77
import { isUndefined } from '@lwc/shared';
8-
import { WireAdapter, DataCallback } from '@lwc/engine-core';
8+
import { WireConfigValue, WireAdapter, DataCallback } from '@lwc/engine-core';
99
import { ValueChangedEvent } from './value-changed-event';
1010

1111
const { freeze, defineProperty, isExtensible } = Object;
@@ -196,7 +196,7 @@ class LegacyWireAdapterBridge implements WireAdapter {
196196

197197
protected eventTarget: WireEventTarget;
198198

199-
update(config: Record<string, any>) {
199+
update(config: WireConfigValue) {
200200
if (this.isFirstUpdate) {
201201
// this is a special case for legacy wire adapters: when all the config params are undefined,
202202
// the config on the wire adapter should not be called until one of them changes.

0 commit comments

Comments
 (0)