web-component-wrapper 0.0.339 → 0.0.340
Sign up to get free protection for your applications and to get access to all the features.
- package/React.d.ts +1 -1
- package/Web.d.ts +3 -3
- package/index.d.ts +1 -1
- package/package.json +1 -1
- package/type.d.ts +8 -5
package/React.d.ts
CHANGED
@@ -58,7 +58,7 @@ export declare class ReactWeb<TElement = HTMLElement, ExternalProperties extends
|
|
58
58
|
*
|
59
59
|
* @returns Nothing.
|
60
60
|
*/
|
61
|
-
reflectExternalProperties(properties: ExternalProperties): void;
|
61
|
+
reflectExternalProperties(properties: Partial<ExternalProperties>): void;
|
62
62
|
/**
|
63
63
|
* Method which does the rendering job. Should be called when ever state
|
64
64
|
* changes should be projected to the hosts dom content.
|
package/Web.d.ts
CHANGED
@@ -417,7 +417,7 @@ export declare class Web<TElement = HTMLElement, ExternalProperties extends Mapp
|
|
417
417
|
*
|
418
418
|
* @returns Nothing.
|
419
419
|
*/
|
420
|
-
reflectExternalProperties(properties: ExternalProperties): void;
|
420
|
+
reflectExternalProperties(properties: Partial<ExternalProperties>): void;
|
421
421
|
/**
|
422
422
|
* Reflects wrapped component state back to web-component's attributes and
|
423
423
|
* properties.
|
@@ -425,7 +425,7 @@ export declare class Web<TElement = HTMLElement, ExternalProperties extends Mapp
|
|
425
425
|
*
|
426
426
|
* @returns Nothing.
|
427
427
|
*/
|
428
|
-
reflectProperties(properties: ExternalProperties): void;
|
428
|
+
reflectProperties(properties: Partial<ExternalProperties>): void;
|
429
429
|
/**
|
430
430
|
* Triggers a new rendering cycle by respecting batch configuration.
|
431
431
|
* @param reason - A description why rendering should be triggered.
|
@@ -441,7 +441,7 @@ export declare class Web<TElement = HTMLElement, ExternalProperties extends Mapp
|
|
441
441
|
*
|
442
442
|
* @returns Mapped properties or null if nothing could be mapped.
|
443
443
|
*/
|
444
|
-
reflectEventToProperties(name: string, parameters: Array<unknown>): ExternalProperties | null;
|
444
|
+
reflectEventToProperties(name: string, parameters: Array<unknown>): Partial<ExternalProperties> | null;
|
445
445
|
/**
|
446
446
|
* Evaluates given property value depending on its type specification and
|
447
447
|
* registers in properties mapping object.
|
package/index.d.ts
CHANGED
@@ -15,5 +15,5 @@ export declare const Web: typeof WebImport;
|
|
15
15
|
*
|
16
16
|
* @returns Generated object to register and retrieve generated web component.
|
17
17
|
*/
|
18
|
-
export declare const wrapAsWebComponent: <Type extends ComponentType = ComponentType, ExternalProperties extends Mapping<unknown> = Mapping<unknown>, InternalProperties extends Mapping<unknown> = Mapping<unknown>,
|
18
|
+
export declare const wrapAsWebComponent: <Type extends ComponentType = ComponentType, ExternalProperties extends Mapping<unknown> = Mapping<unknown>, InternalProperties extends Mapping<unknown> = Mapping<unknown>, EventParameters extends unknown[] = unknown[]>(component: Type, nameHint?: string, configuration?: WebComponentConfiguration<ExternalProperties, InternalProperties, EventParameters>) => WebComponentAPI;
|
19
19
|
export default wrapAsWebComponent;
|
package/package.json
CHANGED
package/type.d.ts
CHANGED
@@ -11,9 +11,12 @@ export declare type CompiledDomNodeTemplateItem = {
|
|
11
11
|
};
|
12
12
|
export declare type CompiledDomNodeTemplate<NodeType = Node> = Map<NodeType, CompiledDomNodeTemplateItem>;
|
13
13
|
export declare type EventCallbackMapping = Map<string, () => void>;
|
14
|
-
export declare type EventMapping<ExternalProperties extends Mapping<unknown> = Mapping<unknown>, InternalProperties extends Mapping<unknown> = Mapping<unknown>> = [
|
15
|
-
|
16
|
-
|
14
|
+
export declare type EventMapping<ExternalProperties extends Mapping<unknown> = Mapping<unknown>, InternalProperties extends Mapping<unknown> = Mapping<unknown>> = ([
|
15
|
+
Partial<ExternalProperties>,
|
16
|
+
Partial<InternalProperties>
|
17
|
+
] | Partial<ExternalProperties>);
|
18
|
+
export declare type EventMapper<E extends Mapping<unknown> = Mapping<unknown>, I extends Mapping<unknown> = Mapping<unknown>, P extends Array<unknown> = Array<unknown>> = (..._parameters: P) => EventMapping<E, I>;
|
19
|
+
export declare type EventToPropertyMapping<E extends Mapping<unknown> = Mapping<unknown>, I extends Mapping<unknown> = Mapping<unknown>, P extends Array<unknown> = Array<unknown>> = Mapping<true | EventMapper<E, I, P>>;
|
17
20
|
export declare type AttributesReflectionConfiguration = Array<string> | Map<string, string | ValueOf<typeof PropertyTypes>> | string | Mapping<ValueOf<typeof PropertyTypes> | string>;
|
18
21
|
export declare type ScopeDeclaration = Array<string> | Mapping<unknown>;
|
19
22
|
export declare type PreCompiledItem = {
|
@@ -26,10 +29,10 @@ export declare type ReactRenderItemsFactory = Array<ReactRenderItemFactory> | Re
|
|
26
29
|
export declare type ReactRenderBaseItem = ReactElement | string | null;
|
27
30
|
export declare type ReactRenderItem = ((..._parameters: Array<unknown>) => ReactRenderBaseItem) | ReactRenderBaseItem;
|
28
31
|
export declare type ReactRenderItems = Array<ReactRenderItem> | ReactRenderItem;
|
29
|
-
export interface WebComponentConfiguration<ExternalProperties extends Mapping<unknown> = Mapping<unknown>, InternalProperties extends Mapping<unknown> = Mapping<unknown>,
|
32
|
+
export interface WebComponentConfiguration<ExternalProperties extends Mapping<unknown> = Mapping<unknown>, InternalProperties extends Mapping<unknown> = Mapping<unknown>, EventParameters extends Array<unknown> = Array<unknown>> {
|
30
33
|
attachWebComponentAdapterIfNotExists?: boolean;
|
31
34
|
controllableProperties?: Array<string>;
|
32
|
-
eventToPropertyMapping?: EventToPropertyMapping<ExternalProperties, InternalProperties,
|
35
|
+
eventToPropertyMapping?: EventToPropertyMapping<ExternalProperties, InternalProperties, EventParameters>;
|
33
36
|
internalProperties?: InternalProperties;
|
34
37
|
propertiesToReflectAsAttributes?: AttributesReflectionConfiguration;
|
35
38
|
propertyAliases?: Mapping;
|