@mappable-world/mappable-types 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +13 -0
- package/imperative/MMapReactContainer/index.d.ts +2 -2
- package/main.d.ts +7 -1
- package/package.json +3 -3
- package/reactify/index.d.ts +8 -0
- package/reactify/reactify.d.ts +4 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright 2023 Mappable authors
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type TReact from "react";
|
|
2
2
|
import type { Context } from "../Entities";
|
|
3
|
-
import { reactify } from "../../reactify";
|
|
4
3
|
import { MMapGroupEntity } from "../MMapEnities";
|
|
4
|
+
import { overrideKeyReactify } from "../wrappers";
|
|
5
5
|
interface MMapReactContainerPropsImpl<TContext> {
|
|
6
6
|
onElement: (element?: Element) => void;
|
|
7
7
|
onContext: (context?: TContext) => void;
|
|
@@ -22,7 +22,7 @@ declare class MMapReactContainer extends MMapGroupEntity<ComputedMMapReactContai
|
|
|
22
22
|
tagName: string;
|
|
23
23
|
};
|
|
24
24
|
/** @internal */
|
|
25
|
-
static [
|
|
25
|
+
static [overrideKeyReactify]: import("../../reactify/reactify").CustomReactify<MMapReactContainer, TReact.FC<MMapReactContainerProps<unknown> & {
|
|
26
26
|
children?: TReact.ReactNode;
|
|
27
27
|
}>>;
|
|
28
28
|
element?: Element;
|
package/main.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
export * from "./imperative";
|
|
2
|
-
export
|
|
2
|
+
export * as __implReactify from "./reactify";
|
|
3
|
+
export declare const __implReactifyOverride: (reactify: import("./reactify").Reactify) => {
|
|
4
|
+
reactify: import("./reactify").Reactify;
|
|
5
|
+
MMapReactContainer: import("react").FC<import("./imperative/MMapReactContainer").MMapReactContainerProps<unknown> & {
|
|
6
|
+
children?: import("react").ReactNode;
|
|
7
|
+
}>;
|
|
8
|
+
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mappable-world/mappable-types",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Types for mappable maps library",
|
|
5
5
|
"main": "",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"keywords": [
|
|
8
|
-
"mappable",
|
|
8
|
+
"mappable-world",
|
|
9
9
|
"api",
|
|
10
10
|
"map",
|
|
11
11
|
"mappable",
|
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
"registry": "https://registry.npmjs.org"
|
|
17
17
|
},
|
|
18
18
|
"homepage": "https://mappable.world",
|
|
19
|
-
"license": "
|
|
19
|
+
"license": "Apache-2.0"
|
|
20
20
|
}
|
package/reactify/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Reactify, ReactifyEntity, ReactifiedEntity, ReactifyModule, ReactifiedModule } from "./reactify";
|
|
2
|
+
import type { MMapReactContainer } from "../imperative/MMapReactContainer";
|
|
2
3
|
import { overrideKeyReactify } from "../imperative/wrappers";
|
|
3
4
|
type TReact = typeof import("react");
|
|
4
5
|
type TReactDOM = typeof import("react-dom");
|
|
@@ -8,3 +9,10 @@ export type GenericReactify = {
|
|
|
8
9
|
bindTo(React: TReact, ReactDOM: TReactDOM): Reactify;
|
|
9
10
|
};
|
|
10
11
|
export declare const reactify: Readonly<GenericReactify>;
|
|
12
|
+
declare module "./reactify" {
|
|
13
|
+
interface ReactifyModule<TModule extends BaseModule = BaseModule> {
|
|
14
|
+
(module: typeof import("../index")): ReactifiedModule<BaseModule & typeof import("../index") & {
|
|
15
|
+
MMapReactContainer: typeof MMapReactContainer;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
}
|
package/reactify/reactify.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type Reactify = {
|
|
|
18
18
|
export declare const moduleOverrideExport: string;
|
|
19
19
|
export type CustomReactify<TEntity extends GenericEntity<unknown>, TResult> = (ctor: EntityConstructor<TEntity>, params: {
|
|
20
20
|
reactify: {
|
|
21
|
-
module:
|
|
21
|
+
module: ReactifyModule;
|
|
22
22
|
entity<T extends EntityConstructor<GenericEntity<unknown>> = EntityConstructor<TEntity>>(...args: Parameters<InternalReactifyEntity<T>>): ReturnType<InternalReactifyEntity<T>>;
|
|
23
23
|
context: <TContext extends Context<unknown>>(context?: TContext) => TReact.Context<unknown>;
|
|
24
24
|
};
|
|
@@ -33,7 +33,9 @@ type InternalReactify<TEntity extends GenericEntity<unknown>> = (ctor: EntityCon
|
|
|
33
33
|
type InternalReactifyEntity<TCtor extends EntityConstructor<GenericEntity<unknown>>> = (ctor: TCtor, displayName?: string) => TCtor extends Overrided<infer TResult> ? TResult : ReturnType<InternalReactify<InstanceType<TCtor>>>;
|
|
34
34
|
export type ReactifyEntity = <TCtor extends EntityConstructor<GenericEntity<unknown>>>(...args: Parameters<InternalReactifyEntity<TCtor>>) => ReturnType<InternalReactifyEntity<TCtor>>;
|
|
35
35
|
export type ReactifiedEntity<TCtor extends EntityConstructor<GenericEntity<unknown>>> = ReturnType<InternalReactifyEntity<TCtor>>;
|
|
36
|
-
export
|
|
36
|
+
export interface ReactifyModule<TModule extends BaseModule = BaseModule> {
|
|
37
|
+
(module: TModule): ReactifiedModule<TModule>;
|
|
38
|
+
}
|
|
37
39
|
export type GetReactContext<TContext extends Context<unknown>> = (context?: TContext | undefined) => React.Context<unknown>;
|
|
38
40
|
export type ReactifiedModule<TModule extends BaseModule> = {
|
|
39
41
|
[Property in keyof TModule]: TModule[Property] extends EntityConstructor<GenericEntity<unknown>> ? ReturnType<InternalReactifyEntity<TModule[Property]>> : TModule[Property] extends typeof Context ? ReturnType<GetReactContext<TModule[Property]>> : TModule[Property];
|