@lwc/engine-core
Advanced tools
Comparing version 7.2.0 to 7.3.0-alpha.0
@@ -1,2 +0,2 @@ | ||
import { WireAdapterConstructor } from '../wiring'; | ||
import type { ConfigValue, ContextValue, ReplaceReactiveValues, WireAdapterConstructor, WireDecorator } from '../wiring'; | ||
/** | ||
@@ -13,3 +13,3 @@ * Decorator factory to wire a property or method to a wire adapter data source. | ||
*/ | ||
export default function wire(adapter: WireAdapterConstructor, config?: Record<string, any>): (value: unknown, context: ClassMemberDecoratorContext | string | symbol) => void; | ||
export default function wire<ReactiveConfig extends ConfigValue = ConfigValue, Value = any, Context extends ContextValue = ContextValue>(adapter: WireAdapterConstructor<ReplaceReactiveValues<ReactiveConfig>, Value, Context>, config?: ReactiveConfig): WireDecorator<Value>; | ||
export declare function internalWireFieldDecorator(key: string): PropertyDescriptor; |
export { createContextProviderWithRegister, createContextWatcher } from './context'; | ||
export { ConfigCallback, ConfigValue, ContextConsumer, ContextProvider, ContextValue, DataCallback, WireAdapter, WireAdapterConstructor, WireAdapterSchemaValue, WireContextSubscriptionPayload, WireContextSubscriptionCallback, } from './types'; | ||
export { ConfigCallback, ConfigValue, ContextConsumer, ContextProvider, ContextValue, DataCallback, ReplaceReactiveValues, WireAdapter, WireAdapterConstructor, WireAdapterSchemaValue, WireContextSubscriptionPayload, WireContextSubscriptionCallback, WireDecorator, } from './types'; | ||
export { connectWireAdapters, disconnectWireAdapters, installWireAdapters, storeWiredFieldMeta, storeWiredMethodMeta, } from './wiring'; |
@@ -19,2 +19,22 @@ import type { LightningElement } from '../base-lightning-element'; | ||
} | ||
/** | ||
* The decorator returned by `@wire()`; not the `wire` factory function. | ||
* | ||
* If you're using `@wire(adapter) property` and getting an opaque type error, ensure that the | ||
* property is explicitly typed and the type matches the value used by the adapter. Note that one | ||
* of the following conditions must always be true: | ||
* - The adapter uses `undefined` as a possible value | ||
* - The property is marked as optional | ||
* - The property is assigned a default value (not provided by the adapter) | ||
*/ | ||
export interface WireDecorator<Value = any> { | ||
/** Property decorator for `"experimentalDecorators": false`. */ | ||
<Class extends LightningElement>(target: undefined, ctx: ClassFieldDecoratorContext<Class, Value>): void; | ||
/** Method decorator for `"experimentalDecorators": false`. */ | ||
<Class extends LightningElement>(target: DataCallback<Value>, ctx: ClassMethodDecoratorContext<Class, DataCallback<Value>>): void | DataCallback<Value>; | ||
/** Property decorator for `"experimentalDecorators": true`. */ | ||
<K extends string | symbol>(target: Record<K, Value>, propertyKey: K): void; | ||
/** Method decorator for `"experimentalDecorators": true`. */ | ||
<K extends string | symbol>(target: Record<K, DataCallback<Value>>, propertyKey: K, descriptor: TypedPropertyDescriptor<DataCallback<Value>>): void; | ||
} | ||
export interface WireDef { | ||
@@ -53,1 +73,9 @@ method?: (data: any) => void; | ||
export type RegisterContextProviderFn = (element: HostElement, adapterContextToken: string, onContextSubscription: WireContextSubscriptionCallback) => void; | ||
/** | ||
* String values starting with "$" are reactive; they get replaced by values from the component. | ||
* We don't have access to the component, and we don't expect all reactive strings to be typed as | ||
* literals, so we just replace all strings with `any`. | ||
*/ | ||
export type ReplaceReactiveValues<T> = { | ||
[K in keyof T]: T[K] extends string ? any : T[K]; | ||
}; |
@@ -7,3 +7,3 @@ { | ||
"name": "@lwc/engine-core", | ||
"version": "7.2.0", | ||
"version": "7.3.0-alpha.0", | ||
"description": "Core LWC engine APIs.", | ||
@@ -46,5 +46,5 @@ "keywords": [ | ||
"dependencies": { | ||
"@lwc/features": "7.2.0", | ||
"@lwc/shared": "7.2.0", | ||
"@lwc/signals": "7.2.0" | ||
"@lwc/features": "7.3.0-alpha.0", | ||
"@lwc/shared": "7.3.0-alpha.0", | ||
"@lwc/signals": "7.3.0-alpha.0" | ||
}, | ||
@@ -54,2 +54,2 @@ "devDependencies": { | ||
} | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1256501
17286
382
1
+ Added@lwc/features@7.3.0-alpha.0(transitive)
+ Added@lwc/shared@7.3.0-alpha.0(transitive)
+ Added@lwc/signals@7.3.0-alpha.0(transitive)
- Removed@lwc/features@7.2.0(transitive)
- Removed@lwc/shared@7.2.0(transitive)
- Removed@lwc/signals@7.2.0(transitive)
Updated@lwc/features@7.3.0-alpha.0
Updated@lwc/shared@7.3.0-alpha.0
Updated@lwc/signals@7.3.0-alpha.0