@cyclomedia/streetsmart-api 23.12.3

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.
Files changed (3) hide show
  1. package/README.md +30 -0
  2. package/index.d.ts +80 -0
  3. package/package.json +49 -0
package/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # Streetsmart API
2
+
3
+ This Streetsmart api package provides programmatic access to most of the UI components of the Streetsmart Web application [here](https://streetsmart.cyclomedia.com).
4
+
5
+ ---
6
+
7
+ ### Setup
8
+
9
+ First install the package using npm or yarn.
10
+
11
+ `npm i @cyclomedia/streetsmart-api`
12
+
13
+ Then import the package like
14
+
15
+ `import StreetSmartApi from "@cyclomedia/streetsmart-api";`
16
+
17
+ Please note that the package only exposes one default export and no named exports.
18
+
19
+ Hence `import { init } from "@cyclomedia/streetsmart-api"` should not be attempted.
20
+
21
+ ### Init
22
+
23
+ The viewer can be initialized by calling. Please see the Typescript docs for more info.
24
+
25
+ `StreetSmartApi.init({options})`
26
+
27
+ ### Destroy
28
+
29
+ The viewer can be destroyed by calling
30
+ `StreetSmartApi.destroy(options)`
package/index.d.ts ADDED
@@ -0,0 +1,80 @@
1
+ declare module '@cyclomedia/streetsmart-api' {
2
+ export interface ApiOptions {
3
+ targetElement: HTMLElement | null;
4
+ username?: string;
5
+ password?: string;
6
+ loginOauth?: boolean;
7
+ clientId?: string;
8
+ loginRedirectUri?: string;
9
+ logoutRedirectUri?: string;
10
+ tid?: string;
11
+ apiKey: string;
12
+ srs: string;
13
+ locale?: string;
14
+ overlayDrawDistance?: number;
15
+ configurationUrl?: string;
16
+ staticBaseUrl?: string;
17
+ addressSettings?: {
18
+ locale: string;
19
+ database: string;
20
+ };
21
+ }
22
+
23
+ type OpenViewerQuery =
24
+ | string
25
+ | number[]
26
+ | {
27
+ coordinates: number[];
28
+ dateRange?: {
29
+ from: string;
30
+ to: string;
31
+ };
32
+ };
33
+
34
+ interface OpenViewerOptions {
35
+ viewerType: [string] | string;
36
+ srs: string;
37
+ panoramaViewer?: any;
38
+ obliqueViewer?: any;
39
+ pointcloudViewer?: any;
40
+ meshviewer?: any;
41
+ }
42
+
43
+ export function init(options: ApiOptions): Promise<any>;
44
+
45
+ export function open(query: OpenViewerQuery, options: OpenViewerOptions): Promise<any>;
46
+
47
+ export function destroy(options: Pick<ApiOptions, 'targetElement' | 'loginOauth'>): void;
48
+
49
+ export function destroy(options: { targetElement: Element; loginOauth: boolean }): Promise<void>;
50
+
51
+ export function getApplicationName(): string;
52
+
53
+ export function getApplicationVersion(): string;
54
+
55
+ export function getPermissions(): string[];
56
+
57
+ export function getAddressSettings(): { locale: string; database: string };
58
+
59
+ export function setAddressSettings(addressSettings: { locale: string; database: string }): void;
60
+
61
+ export function getDebugLogs(): string[];
62
+
63
+ export function on(type: string, callback: (event: Event) => void): void;
64
+
65
+ export function off(type: string, callback: (event: Event) => void): void;
66
+
67
+ export function viewerAdded(viewer: any): void;
68
+
69
+ export function viewerRemoved(wid: any): void;
70
+
71
+ export function viewerUpdated(wid: any, oldViewer: any): void;
72
+
73
+ export function measurementSaved(measurement: any, wid: any): void;
74
+
75
+ export function measurementChanged(measurement: any, wid: any): void;
76
+
77
+ export function measurementStarted(measurement: any, wid: any): void;
78
+
79
+ export function measurementStopped(measurement: any, wid: any): void;
80
+ }
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@cyclomedia/streetsmart-api",
3
+ "version": "23.12.3",
4
+ "description": "The Streetsmart API wrapped as a npm package",
5
+ "scripts": {
6
+ "build": "scripts/build.sh",
7
+ "rollup": "rollup -c",
8
+ "docs": "npx typedoc --out docs src --theme minimal",
9
+ "test": "jest"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/cyclomedia/streetsmart.git"
14
+ },
15
+ "author": "Cyclomedia Technology B.V.",
16
+ "license": "UNLICENSED",
17
+ "bugs": {
18
+ "url": "https://github.com/cyclomedia/streetsmart/issues"
19
+ },
20
+ "publishConfig": {
21
+ "access": "public"
22
+ },
23
+ "homepage": "https://github.com/cyclomedia/streetsmart#readme",
24
+ "peerDependencies": {
25
+ "react": "^18.2.0",
26
+ "react-dom": "^18.2.0"
27
+ },
28
+ "devDependencies": {
29
+ "@rollup/plugin-commonjs": "^25.0.7",
30
+ "@rollup/plugin-node-resolve": "^15.2.3",
31
+ "@rollup/plugin-replace": "^5.0.5",
32
+ "@rollup/plugin-typescript": "^11.1.5",
33
+ "@rollup/rollup-darwin-arm64": "^4.1.4",
34
+ "@types/jest": "^29.5.7",
35
+ "jest": "^29.7.0",
36
+ "rollup": "^4.1.4",
37
+ "rollup-plugin-dts": "^6.1.0",
38
+ "ts-jest": "^29.1.1",
39
+ "typedoc": "^0.25.2",
40
+ "typescript": "^5.2.2"
41
+ },
42
+ "main": "dist/cjs/index.js",
43
+ "module": "dist/esm/index.js",
44
+ "files": [
45
+ "dist",
46
+ "index.d.ts"
47
+ ],
48
+ "types": "index.d.ts"
49
+ }