@portaki/module-sdk 0.1.0
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/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/package.json +35 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type LangCode = 'fr' | 'en';
|
|
3
|
+
export interface PortakiGuestProperty {
|
|
4
|
+
id: string;
|
|
5
|
+
trainStationCode?: string;
|
|
6
|
+
checklistItems?: readonly {
|
|
7
|
+
id: string;
|
|
8
|
+
labelFr: string;
|
|
9
|
+
labelEn: string;
|
|
10
|
+
}[];
|
|
11
|
+
}
|
|
12
|
+
export interface PortakiGuestStay {
|
|
13
|
+
id: string;
|
|
14
|
+
}
|
|
15
|
+
export interface PortakiRenderContext {
|
|
16
|
+
property: PortakiGuestProperty;
|
|
17
|
+
stay?: PortakiGuestStay;
|
|
18
|
+
lang: LangCode;
|
|
19
|
+
}
|
|
20
|
+
export interface PortakiModuleDefinition {
|
|
21
|
+
id: string;
|
|
22
|
+
label: Record<string, string>;
|
|
23
|
+
icon: string;
|
|
24
|
+
navSlot?: 'section' | 'bottom-bar' | 'poi-overlay';
|
|
25
|
+
mapOverlay?: boolean;
|
|
26
|
+
visibleOnStatus?: readonly string[];
|
|
27
|
+
render: (ctx: PortakiRenderContext) => ReactNode;
|
|
28
|
+
mapMarkers?: (ctx: PortakiRenderContext) => Promise<unknown[]>;
|
|
29
|
+
}
|
|
30
|
+
export declare function definePortakiModule(def: PortakiModuleDefinition): PortakiModuleDefinition;
|
|
31
|
+
/** Chargement dynamique du module par défaut (`definePortakiModule`). */
|
|
32
|
+
export type PortakiModuleLoader = () => Promise<{
|
|
33
|
+
default: PortakiModuleDefinition;
|
|
34
|
+
}>;
|
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
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,CAAA;CAAE,CAAC,CAAA"}
|
package/dist/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@portaki/module-sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Portaki guest modules SDK for React / Next.js",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/portaki/portaki-sdk.git"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"registry": "https://registry.npmjs.org",
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"main": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"files": ["dist"],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsc -p tsconfig.build.json",
|
|
26
|
+
"clean": "rm -rf dist"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"react": ">=18"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/react": "^19",
|
|
33
|
+
"typescript": "^5"
|
|
34
|
+
}
|
|
35
|
+
}
|