web-component-wrapper 0.0.416 → 0.0.418

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/type.d.ts +23 -23
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-component-wrapper",
3
- "version": "0.0.416",
3
+ "version": "0.0.418",
4
4
  "description": "Generic web-component base class and framework specific wrapper.",
5
5
  "keywords": [
6
6
  "component",
@@ -119,8 +119,8 @@
119
119
  }
120
120
  },
121
121
  "engines": {
122
- "node": ">=17",
123
- "npm": ">=7"
122
+ "node": ">=19",
123
+ "npm": ">=8"
124
124
  },
125
125
  "resolutions": {
126
126
  "@types/webpack": "https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.1.1.tgz",
package/type.d.ts CHANGED
@@ -2,33 +2,33 @@ import PropertyTypes, { ValidationMap } from 'clientnode/property-types';
2
2
  import { Mapping, TemplateFunction, ValueOf } from 'clientnode/type';
3
3
  import React, { ComponentType as ReactComponentType, HTMLAttributes, ReactElement } from 'react';
4
4
  import Web from './Web';
5
- export declare type CompiledDomNodeTemplateItem = {
5
+ export type CompiledDomNodeTemplateItem = {
6
6
  children: Array<CompiledDomNodeTemplate>;
7
7
  error: null | string;
8
8
  scopeNames: Array<string>;
9
9
  template: string;
10
10
  templateFunction: TemplateFunction;
11
11
  };
12
- export declare type CompiledDomNodeTemplate<NodeType = Node> = Map<NodeType, CompiledDomNodeTemplateItem>;
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>> = (null | [
12
+ export type CompiledDomNodeTemplate<NodeType = Node> = Map<NodeType, CompiledDomNodeTemplateItem>;
13
+ export type EventCallbackMapping = Map<string, () => void>;
14
+ export type EventMapping<ExternalProperties extends Mapping<unknown> = Mapping<unknown>, InternalProperties extends Mapping<unknown> = Mapping<unknown>> = (null | [
15
15
  Partial<ExternalProperties>,
16
16
  Partial<InternalProperties>
17
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> | Promise<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>>;
20
- export declare type PropertyConfiguration = string | ValueOf<typeof PropertyTypes>;
21
- export declare type ValidationMapping = ValidationMap<ValueOf<typeof PropertyTypes>>;
22
- export declare type PropertiesValidationMap = Mapping<ValueOf<typeof PropertyTypes>> & ValidationMapping;
23
- export declare type PropertiesConfiguration = Mapping | PropertiesValidationMap;
24
- export declare type NormalizedAttributesReflectionConfiguration = Map<string, PropertyConfiguration>;
25
- export declare type AttributesReflectionConfiguration = (string | Array<string> | PropertiesConfiguration | NormalizedAttributesReflectionConfiguration);
26
- export declare type ScopeDeclaration = Array<string> | Mapping<unknown>;
27
- export declare type PreCompiledItem = {
18
+ export 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> | Promise<EventMapping<E, I>>;
19
+ export 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>>;
20
+ export type PropertyConfiguration = string | ValueOf<typeof PropertyTypes>;
21
+ export type ValidationMapping = ValidationMap<ValueOf<typeof PropertyTypes>>;
22
+ export type PropertiesValidationMap = Mapping<ValueOf<typeof PropertyTypes>> & ValidationMapping;
23
+ export type PropertiesConfiguration = Mapping | PropertiesValidationMap;
24
+ export type NormalizedAttributesReflectionConfiguration = Map<string, PropertyConfiguration>;
25
+ export type AttributesReflectionConfiguration = (string | Array<string> | PropertiesConfiguration | NormalizedAttributesReflectionConfiguration);
26
+ export type ScopeDeclaration = Array<string> | Mapping<unknown>;
27
+ export type PreCompiledItem = {
28
28
  originalScopeNames: Array<string>;
29
29
  templateFunction: TemplateFunction;
30
30
  };
31
- export declare type ReactComponentBaseProperties<TElement = HTMLElement> = Mapping<unknown> & {
31
+ export type ReactComponentBaseProperties<TElement = HTMLElement> = Mapping<unknown> & {
32
32
  children?: Array<React.ReactNode> | React.ReactNode;
33
33
  dangerouslySetInnerHTML?: HTMLAttributes<TElement>['dangerouslySetInnerHTML'];
34
34
  key?: string;
@@ -36,12 +36,12 @@ export declare type ReactComponentBaseProperties<TElement = HTMLElement> = Mappi
36
36
  current?: ComponentAdapter;
37
37
  };
38
38
  };
39
- export declare type ReactRenderBaseItemFactory = (_scope: Mapping<unknown>) => ReactRenderBaseItem;
40
- export declare type ReactRenderItemFactory = (_scope: Mapping<unknown>) => ReactRenderItem;
41
- export declare type ReactRenderItemsFactory = Array<ReactRenderItemFactory> | ReactRenderItemFactory;
42
- export declare type ReactRenderBaseItem = ReactElement | string | null;
43
- export declare type ReactRenderItem = ((..._parameters: Array<unknown>) => ReactRenderBaseItem) | ReactRenderBaseItem;
44
- export declare type ReactRenderItems = Array<ReactRenderItem> | ReactRenderItem;
39
+ export type ReactRenderBaseItemFactory = (_scope: Mapping<unknown>) => ReactRenderBaseItem;
40
+ export type ReactRenderItemFactory = (_scope: Mapping<unknown>) => ReactRenderItem;
41
+ export type ReactRenderItemsFactory = Array<ReactRenderItemFactory> | ReactRenderItemFactory;
42
+ export type ReactRenderBaseItem = ReactElement | string | null;
43
+ export type ReactRenderItem = ((..._parameters: Array<unknown>) => ReactRenderBaseItem) | ReactRenderBaseItem;
44
+ export type ReactRenderItems = Array<ReactRenderItem> | ReactRenderItem;
45
45
  export interface WebComponentConfiguration<ExternalProperties extends Mapping<unknown> = Mapping<unknown>, InternalProperties extends Mapping<unknown> = Mapping<unknown>, EventParameters extends Array<unknown> = Array<unknown>> {
46
46
  attachWebComponentAdapterIfNotExists?: boolean;
47
47
  controllableProperties?: Array<string>;
@@ -62,12 +62,12 @@ export interface StaticWebComponent<ComponentType = unknown, ExternalProperties
62
62
  };
63
63
  };
64
64
  }
65
- export declare type ComponentType<PropertyTypes = Mapping<unknown>> = Omit<ReactComponentType<PropertyTypes>, 'propTypes'> & StaticWebComponent;
65
+ export type ComponentType<PropertyTypes = Mapping<unknown>> = Omit<ReactComponentType<PropertyTypes>, 'propTypes'> & StaticWebComponent;
66
66
  export interface ComponentAdapter<Properties = Mapping<unknown>, State = Mapping<unknown>> {
67
67
  properties?: Properties;
68
68
  state?: State;
69
69
  }
70
- export declare type WebComponentAPI<TElement = HTMLElement, ExternalProperties extends Mapping<unknown> = Mapping<unknown>, InternalProperties extends Mapping<unknown> = Mapping<unknown>, Type extends typeof Web<TElement, ExternalProperties, InternalProperties> = typeof Web<TElement, ExternalProperties, InternalProperties>> = {
70
+ export type WebComponentAPI<TElement = HTMLElement, ExternalProperties extends Mapping<unknown> = Mapping<unknown>, InternalProperties extends Mapping<unknown> = Mapping<unknown>, Type extends typeof Web<TElement, ExternalProperties, InternalProperties> = typeof Web<TElement, ExternalProperties, InternalProperties>> = {
71
71
  component: Type;
72
72
  register: (tagName?: string) => void;
73
73
  };