@photon-os/sdk 0.5.1 → 1.0.0-alpha.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.mts +125 -0
- package/dist/index.d.ts +125 -0
- package/dist/index.js +1300 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1290 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +41 -29
- package/lib/CoreServices/Apps/App.d.ts +0 -6
- package/lib/CoreServices/Apps/App.js +0 -9
- package/lib/CoreServices/Apps/AppRegistry.d.ts +0 -6
- package/lib/CoreServices/Apps/AppRegistry.js +0 -15
- package/lib/CoreServices/Apps/Launcher.d.ts +0 -5
- package/lib/CoreServices/Apps/Launcher.js +0 -9
- package/lib/CoreServices/Apps/PhotonApp.d.ts +0 -6
- package/lib/CoreServices/Apps/PhotonApp.js +0 -33
- package/lib/CoreServices/Apps/PhotonAppMode.d.ts +0 -5
- package/lib/CoreServices/Apps/PhotonAppMode.js +0 -8
- package/lib/CoreServices/Apps/UserPreferences.d.ts +0 -6
- package/lib/CoreServices/Apps/UserPreferences.js +0 -15
- package/lib/CoreServices/HomeBar.d.ts +0 -4
- package/lib/CoreServices/HomeBar.js +0 -8
- package/lib/CoreServices/StatusBar/StatusBar.d.ts +0 -8
- package/lib/CoreServices/StatusBar/StatusBar.js +0 -36
- package/lib/CoreServices/StatusBar/StatusBarContentType.d.ts +0 -5
- package/lib/CoreServices/StatusBar/StatusBarContentType.js +0 -8
- package/lib/SecondLife/PhotonTool.d.ts +0 -33
- package/lib/SecondLife/PhotonTool.js +0 -100
- package/lib/SecondLife/SecondLifeDevice.d.ts +0 -9
- package/lib/SecondLife/SecondLifeDevice.js +0 -12
- package/lib/SecondLife/SecondLifeIdentity.d.ts +0 -4
- package/lib/SecondLife/SecondLifeIdentity.js +0 -9
- package/lib/SecondLife/SecondLifeProxy.d.ts +0 -5
- package/lib/SecondLife/SecondLifeProxy.js +0 -8
- package/lib/SecondLife/SecondLifeRegistry.d.ts +0 -5
- package/lib/SecondLife/SecondLifeRegistry.js +0 -22
- package/lib/Sensor/Sensor.d.ts +0 -6
- package/lib/Sensor/Sensor.js +0 -31
- package/lib/Sensor/SensorResult.d.ts +0 -14
- package/lib/Sensor/SensorResult.js +0 -1
- package/lib/SystemEvents/EventManager.d.ts +0 -14
- package/lib/SystemEvents/EventManager.js +0 -38
- package/lib/SystemEvents/LifecycleEventNames.d.ts +0 -5
- package/lib/SystemEvents/LifecycleEventNames.js +0 -8
- package/lib/SystemEvents/LifecycleEvents.d.ts +0 -5
- package/lib/SystemEvents/LifecycleEvents.js +0 -18
- package/lib/SystemMessaging/BrowserMessageListener.d.ts +0 -11
- package/lib/SystemMessaging/BrowserMessageListener.js +0 -21
- package/lib/SystemMessaging/BrowserMessagingTarget.d.ts +0 -9
- package/lib/SystemMessaging/BrowserMessagingTarget.js +0 -13
- package/lib/SystemMessaging/IMessage.d.ts +0 -6
- package/lib/SystemMessaging/IMessage.js +0 -2
- package/lib/SystemMessaging/IMessageListener.d.ts +0 -9
- package/lib/SystemMessaging/IMessageListener.js +0 -2
- package/lib/SystemMessaging/IMessagingTarget.d.ts +0 -5
- package/lib/SystemMessaging/IMessagingTarget.js +0 -2
- package/lib/SystemMessaging/MessageBroker.d.ts +0 -30
- package/lib/SystemMessaging/MessageBroker.js +0 -147
- package/lib/SystemMessaging/SecondLIfeMessagingListener.d.ts +0 -14
- package/lib/SystemMessaging/SecondLIfeMessagingListener.js +0 -28
- package/lib/SystemMessaging/SecondLifeMessagingTarget.d.ts +0 -9
- package/lib/SystemMessaging/SecondLifeMessagingTarget.js +0 -13
- package/lib/SystemMessaging/VoidMessagingTarget.d.ts +0 -7
- package/lib/SystemMessaging/VoidMessagingTarget.js +0 -12
- package/lib/index.d.ts +0 -22
- package/lib/index.js +0 -46
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
type AppBundleId = string;
|
|
2
|
+
type AppDefinition = {
|
|
3
|
+
bundleId: AppBundleId;
|
|
4
|
+
name: string;
|
|
5
|
+
author: string;
|
|
6
|
+
url: string;
|
|
7
|
+
};
|
|
8
|
+
type RunningAppInstance = {
|
|
9
|
+
definition: AppDefinition;
|
|
10
|
+
startedAt: Date;
|
|
11
|
+
lastForegroundedAt: Date;
|
|
12
|
+
isInBackground: boolean;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Value types supported for preferences.
|
|
17
|
+
* Stored as JSONB in the database.
|
|
18
|
+
*/
|
|
19
|
+
type PreferenceValue = string | number | boolean | null | PreferenceValue[] | {
|
|
20
|
+
[key: string]: PreferenceValue;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Represents the authenticated user visible to apps via the SDK.
|
|
25
|
+
* This is a read-only, minimal representation.
|
|
26
|
+
*/
|
|
27
|
+
type PhotonUser = {
|
|
28
|
+
/** Unique user identifier */
|
|
29
|
+
id: string;
|
|
30
|
+
/** User's display name */
|
|
31
|
+
displayName: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
type AppLaunchResult = {
|
|
35
|
+
launched: boolean;
|
|
36
|
+
error: Error | null;
|
|
37
|
+
app: AppDefinition;
|
|
38
|
+
};
|
|
39
|
+
type OperatingSystemAPI = {
|
|
40
|
+
system_homeButton: () => Promise<void>;
|
|
41
|
+
apps_getInstalledApps: () => Promise<AppDefinition[]>;
|
|
42
|
+
apps_launchApp: (app: AppDefinition) => Promise<AppLaunchResult>;
|
|
43
|
+
apps_foregroundApp: (app: AppDefinition) => Promise<void>;
|
|
44
|
+
apps_requestAppInstall: (app: AppDefinition) => Promise<void>;
|
|
45
|
+
apps_requestAppUninstall: (app: AppDefinition) => Promise<void>;
|
|
46
|
+
user_getCurrentUser: () => Promise<PhotonUser>;
|
|
47
|
+
prefs_getSandboxed: (key: string) => Promise<PreferenceValue>;
|
|
48
|
+
prefs_setSandboxed: (key: string, value: PreferenceValue) => Promise<void>;
|
|
49
|
+
prefs_deleteSandboxed: (key: string) => Promise<void>;
|
|
50
|
+
prefs_getShared: (key: string) => Promise<PreferenceValue>;
|
|
51
|
+
prefs_setShared: (key: string, value: PreferenceValue) => Promise<void>;
|
|
52
|
+
prefs_deleteShared: (key: string) => Promise<void>;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
declare class AppManager {
|
|
56
|
+
private os;
|
|
57
|
+
constructor(os: OS);
|
|
58
|
+
getInstalledApps(): Promise<AppDefinition[]>;
|
|
59
|
+
launchApp(app: AppDefinition): Promise<AppLaunchResult>;
|
|
60
|
+
requestAppInstall(app: AppDefinition): Promise<void>;
|
|
61
|
+
requestAppUninstall(app: AppDefinition): Promise<void>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Manages user preferences for apps.
|
|
66
|
+
*
|
|
67
|
+
* Sandboxed methods (get, set, delete) store preferences scoped to the calling app.
|
|
68
|
+
* Shared methods (getShared, setShared, deleteShared) store preferences accessible by all apps.
|
|
69
|
+
*/
|
|
70
|
+
declare class PreferencesManager {
|
|
71
|
+
private os;
|
|
72
|
+
constructor(os: OS);
|
|
73
|
+
/**
|
|
74
|
+
* Get a sandboxed preference value (app-specific).
|
|
75
|
+
* Only accessible by the app that set it.
|
|
76
|
+
*/
|
|
77
|
+
get(key: string): Promise<PreferenceValue>;
|
|
78
|
+
/**
|
|
79
|
+
* Set a sandboxed preference value (app-specific).
|
|
80
|
+
* Only accessible by the app that set it.
|
|
81
|
+
*/
|
|
82
|
+
set(key: string, value: PreferenceValue): Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Delete a sandboxed preference (app-specific).
|
|
85
|
+
*/
|
|
86
|
+
delete(key: string): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* Get a shared preference value.
|
|
89
|
+
* Accessible by all apps.
|
|
90
|
+
*/
|
|
91
|
+
getShared(key: string): Promise<PreferenceValue>;
|
|
92
|
+
/**
|
|
93
|
+
* Set a shared preference value.
|
|
94
|
+
* Accessible by all apps.
|
|
95
|
+
*/
|
|
96
|
+
setShared(key: string, value: PreferenceValue): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Delete a shared preference.
|
|
99
|
+
*/
|
|
100
|
+
deleteShared(key: string): Promise<void>;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
declare class UserManager {
|
|
104
|
+
private os;
|
|
105
|
+
constructor(os: OS);
|
|
106
|
+
/** Get the current authenticated user */
|
|
107
|
+
getCurrentUser(): Promise<PhotonUser>;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
type OSConfig = {
|
|
111
|
+
target: Window;
|
|
112
|
+
};
|
|
113
|
+
declare class OS {
|
|
114
|
+
apps: AppManager;
|
|
115
|
+
prefs: PreferencesManager;
|
|
116
|
+
user: UserManager;
|
|
117
|
+
private config;
|
|
118
|
+
constructor(config?: OSConfig);
|
|
119
|
+
homeButton(): Promise<void>;
|
|
120
|
+
getRPCAPI(): Promise<OperatingSystemAPI>;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
declare const VERSION = "1.0.0";
|
|
124
|
+
|
|
125
|
+
export { type AppBundleId, type AppDefinition, type AppLaunchResult, OS, type OSConfig, type OperatingSystemAPI, type PhotonUser, type PreferenceValue, type RunningAppInstance, VERSION };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
type AppBundleId = string;
|
|
2
|
+
type AppDefinition = {
|
|
3
|
+
bundleId: AppBundleId;
|
|
4
|
+
name: string;
|
|
5
|
+
author: string;
|
|
6
|
+
url: string;
|
|
7
|
+
};
|
|
8
|
+
type RunningAppInstance = {
|
|
9
|
+
definition: AppDefinition;
|
|
10
|
+
startedAt: Date;
|
|
11
|
+
lastForegroundedAt: Date;
|
|
12
|
+
isInBackground: boolean;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Value types supported for preferences.
|
|
17
|
+
* Stored as JSONB in the database.
|
|
18
|
+
*/
|
|
19
|
+
type PreferenceValue = string | number | boolean | null | PreferenceValue[] | {
|
|
20
|
+
[key: string]: PreferenceValue;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Represents the authenticated user visible to apps via the SDK.
|
|
25
|
+
* This is a read-only, minimal representation.
|
|
26
|
+
*/
|
|
27
|
+
type PhotonUser = {
|
|
28
|
+
/** Unique user identifier */
|
|
29
|
+
id: string;
|
|
30
|
+
/** User's display name */
|
|
31
|
+
displayName: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
type AppLaunchResult = {
|
|
35
|
+
launched: boolean;
|
|
36
|
+
error: Error | null;
|
|
37
|
+
app: AppDefinition;
|
|
38
|
+
};
|
|
39
|
+
type OperatingSystemAPI = {
|
|
40
|
+
system_homeButton: () => Promise<void>;
|
|
41
|
+
apps_getInstalledApps: () => Promise<AppDefinition[]>;
|
|
42
|
+
apps_launchApp: (app: AppDefinition) => Promise<AppLaunchResult>;
|
|
43
|
+
apps_foregroundApp: (app: AppDefinition) => Promise<void>;
|
|
44
|
+
apps_requestAppInstall: (app: AppDefinition) => Promise<void>;
|
|
45
|
+
apps_requestAppUninstall: (app: AppDefinition) => Promise<void>;
|
|
46
|
+
user_getCurrentUser: () => Promise<PhotonUser>;
|
|
47
|
+
prefs_getSandboxed: (key: string) => Promise<PreferenceValue>;
|
|
48
|
+
prefs_setSandboxed: (key: string, value: PreferenceValue) => Promise<void>;
|
|
49
|
+
prefs_deleteSandboxed: (key: string) => Promise<void>;
|
|
50
|
+
prefs_getShared: (key: string) => Promise<PreferenceValue>;
|
|
51
|
+
prefs_setShared: (key: string, value: PreferenceValue) => Promise<void>;
|
|
52
|
+
prefs_deleteShared: (key: string) => Promise<void>;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
declare class AppManager {
|
|
56
|
+
private os;
|
|
57
|
+
constructor(os: OS);
|
|
58
|
+
getInstalledApps(): Promise<AppDefinition[]>;
|
|
59
|
+
launchApp(app: AppDefinition): Promise<AppLaunchResult>;
|
|
60
|
+
requestAppInstall(app: AppDefinition): Promise<void>;
|
|
61
|
+
requestAppUninstall(app: AppDefinition): Promise<void>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Manages user preferences for apps.
|
|
66
|
+
*
|
|
67
|
+
* Sandboxed methods (get, set, delete) store preferences scoped to the calling app.
|
|
68
|
+
* Shared methods (getShared, setShared, deleteShared) store preferences accessible by all apps.
|
|
69
|
+
*/
|
|
70
|
+
declare class PreferencesManager {
|
|
71
|
+
private os;
|
|
72
|
+
constructor(os: OS);
|
|
73
|
+
/**
|
|
74
|
+
* Get a sandboxed preference value (app-specific).
|
|
75
|
+
* Only accessible by the app that set it.
|
|
76
|
+
*/
|
|
77
|
+
get(key: string): Promise<PreferenceValue>;
|
|
78
|
+
/**
|
|
79
|
+
* Set a sandboxed preference value (app-specific).
|
|
80
|
+
* Only accessible by the app that set it.
|
|
81
|
+
*/
|
|
82
|
+
set(key: string, value: PreferenceValue): Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Delete a sandboxed preference (app-specific).
|
|
85
|
+
*/
|
|
86
|
+
delete(key: string): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* Get a shared preference value.
|
|
89
|
+
* Accessible by all apps.
|
|
90
|
+
*/
|
|
91
|
+
getShared(key: string): Promise<PreferenceValue>;
|
|
92
|
+
/**
|
|
93
|
+
* Set a shared preference value.
|
|
94
|
+
* Accessible by all apps.
|
|
95
|
+
*/
|
|
96
|
+
setShared(key: string, value: PreferenceValue): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Delete a shared preference.
|
|
99
|
+
*/
|
|
100
|
+
deleteShared(key: string): Promise<void>;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
declare class UserManager {
|
|
104
|
+
private os;
|
|
105
|
+
constructor(os: OS);
|
|
106
|
+
/** Get the current authenticated user */
|
|
107
|
+
getCurrentUser(): Promise<PhotonUser>;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
type OSConfig = {
|
|
111
|
+
target: Window;
|
|
112
|
+
};
|
|
113
|
+
declare class OS {
|
|
114
|
+
apps: AppManager;
|
|
115
|
+
prefs: PreferencesManager;
|
|
116
|
+
user: UserManager;
|
|
117
|
+
private config;
|
|
118
|
+
constructor(config?: OSConfig);
|
|
119
|
+
homeButton(): Promise<void>;
|
|
120
|
+
getRPCAPI(): Promise<OperatingSystemAPI>;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
declare const VERSION = "1.0.0";
|
|
124
|
+
|
|
125
|
+
export { type AppBundleId, type AppDefinition, type AppLaunchResult, OS, type OSConfig, type OperatingSystemAPI, type PhotonUser, type PreferenceValue, type RunningAppInstance, VERSION };
|