@hypersoniclabs/helix-sdk 0.1.1 → 0.1.9
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/README.md +954 -2
- package/dist/action-surface.d.ts +182 -0
- package/dist/action-surface.js +1032 -0
- package/dist/action-surface.js.map +1 -0
- package/dist/camera.d.ts +78 -0
- package/dist/camera.js +640 -0
- package/dist/camera.js.map +1 -0
- package/dist/dev-shell/criteria.d.ts +46 -0
- package/dist/dev-shell/criteria.js +98 -0
- package/dist/dev-shell/criteria.js.map +1 -0
- package/dist/dev-shell/index.d.ts +189 -0
- package/dist/dev-shell/index.js +287 -0
- package/dist/dev-shell/index.js.map +1 -0
- package/dist/dev-shell/keys.d.ts +14 -0
- package/dist/dev-shell/keys.js +78 -0
- package/dist/dev-shell/keys.js.map +1 -0
- package/dist/dev-shell/simulator.d.ts +436 -0
- package/dist/dev-shell/simulator.js +1634 -0
- package/dist/dev-shell/simulator.js.map +1 -0
- package/dist/dev-shell/state.d.ts +148 -0
- package/dist/dev-shell/state.js +196 -0
- package/dist/dev-shell/state.js.map +1 -0
- package/dist/device-definition-resolver.d.ts +34 -0
- package/dist/device-definition-resolver.js +172 -0
- package/dist/device-definition-resolver.js.map +1 -0
- package/dist/device-trial.d.ts +3 -0
- package/dist/device-trial.js +132 -0
- package/dist/device-trial.js.map +1 -0
- package/dist/devices.d.ts +228 -0
- package/dist/devices.js +198 -0
- package/dist/devices.js.map +1 -0
- package/dist/dreamerAudio.d.ts +126 -0
- package/dist/dreamerAudio.js +135 -0
- package/dist/dreamerAudio.js.map +1 -0
- package/dist/generated/runtime-contract.d.ts +15529 -0
- package/dist/generated/runtime-contract.js +20470 -0
- package/dist/generated/runtime-contract.js.map +1 -0
- package/dist/index.d.ts +364 -3
- package/dist/index.js +1954 -13
- package/dist/index.js.map +1 -1
- package/dist/interaction-mode.d.ts +172 -0
- package/dist/interaction-mode.js +553 -0
- package/dist/interaction-mode.js.map +1 -0
- package/dist/internal/avatar-pose.d.ts +25 -0
- package/dist/internal/avatar-pose.js +46 -0
- package/dist/internal/avatar-pose.js.map +1 -0
- package/dist/internal/keyed-collection.d.ts +2 -0
- package/dist/internal/keyed-collection.js +12 -0
- package/dist/internal/keyed-collection.js.map +1 -0
- package/dist/internal/vehicle-detach-action.d.ts +2 -0
- package/dist/internal/vehicle-detach-action.js +6 -0
- package/dist/internal/vehicle-detach-action.js.map +1 -0
- package/dist/matchmaking.d.ts +433 -0
- package/dist/matchmaking.js +1487 -0
- package/dist/matchmaking.js.map +1 -0
- package/dist/materials.d.ts +122 -0
- package/dist/materials.js +217 -0
- package/dist/materials.js.map +1 -0
- package/dist/multiplayer-accessors.d.ts +100 -0
- package/dist/multiplayer-accessors.js +200 -0
- package/dist/multiplayer-accessors.js.map +1 -0
- package/dist/multiplayer-contract/avatar-pose.d.ts +112 -0
- package/dist/multiplayer-contract/avatar-pose.js +250 -0
- package/dist/multiplayer-contract/avatar-pose.js.map +1 -0
- package/dist/multiplayer-contract/credential.d.ts +80 -0
- package/dist/multiplayer-contract/credential.js +5 -0
- package/dist/multiplayer-contract/credential.js.map +1 -0
- package/dist/multiplayer-contract/final-rest.d.ts +66 -0
- package/dist/multiplayer-contract/final-rest.js +38 -0
- package/dist/multiplayer-contract/final-rest.js.map +1 -0
- package/dist/multiplayer-contract/index.d.ts +20 -0
- package/dist/multiplayer-contract/index.js +41 -0
- package/dist/multiplayer-contract/index.js.map +1 -0
- package/dist/multiplayer-contract/messages.d.ts +731 -0
- package/dist/multiplayer-contract/messages.js +237 -0
- package/dist/multiplayer-contract/messages.js.map +1 -0
- package/dist/multiplayer-contract/room.d.ts +177 -0
- package/dist/multiplayer-contract/room.js +17 -0
- package/dist/multiplayer-contract/room.js.map +1 -0
- package/dist/multiplayer-contract/state.d.ts +241 -0
- package/dist/multiplayer-contract/state.js +15 -0
- package/dist/multiplayer-contract/state.js.map +1 -0
- package/dist/multiplayer-final-rest.d.ts +32 -0
- package/dist/multiplayer-final-rest.js +217 -0
- package/dist/multiplayer-final-rest.js.map +1 -0
- package/dist/multiplayer.d.ts +624 -0
- package/dist/multiplayer.js +2503 -0
- package/dist/multiplayer.js.map +1 -0
- package/dist/package.json +3 -0
- package/dist/protocol.d.ts +859 -1
- package/dist/protocol.js +117 -5
- package/dist/protocol.js.map +1 -1
- package/dist/runtime-contract/index.d.ts +15 -0
- package/dist/runtime-contract/index.js +12 -0
- package/dist/runtime-contract/index.js.map +1 -0
- package/dist/server-clock.d.ts +25 -0
- package/dist/server-clock.js +88 -0
- package/dist/server-clock.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/universal-vehicles.d.ts +111 -0
- package/dist/universal-vehicles.js +2 -0
- package/dist/universal-vehicles.js.map +1 -0
- package/dist/vault.d.ts +562 -0
- package/dist/vault.js +365 -0
- package/dist/vault.js.map +1 -0
- package/dist/vehicle-specialty-placement.d.ts +28 -0
- package/dist/vehicle-specialty-placement.js +154 -0
- package/dist/vehicle-specialty-placement.js.map +1 -0
- package/dist/vehicle-specialty-transport.d.ts +78 -0
- package/dist/vehicle-specialty-transport.js +183 -0
- package/dist/vehicle-specialty-transport.js.map +1 -0
- package/dist/voice.d.ts +229 -0
- package/dist/voice.js +1348 -0
- package/dist/voice.js.map +1 -0
- package/generated/runtime-contract/helix-runtime-contract.json +13332 -0
- package/generated/runtime-contract/known-answer.json +20471 -0
- package/generated/runtime-contract/known-answer.schema.json +630 -0
- package/generated/runtime-contract/runtime-contract.schema.json +607 -0
- package/generated/runtime-contract/unreal/HelixRuntimeContract.generated.h +908 -0
- package/package.json +44 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,31 +1,392 @@
|
|
|
1
|
-
import { HelixWorldContext, HelixUser } from './protocol';
|
|
2
|
-
|
|
1
|
+
import { HelixInteractionPrompt, HelixNotification, HelixDeviceState, HelixWorldContext, HelixUser, DebugLogEntry, Balance, PurchaseResult, PurchaseContext, PurchaseOptions, Entitlements, ConsumeResult, InventoryItem, EquippedAvatar, EquippedEmotes, EquippedLocomotionPack, AvatarLoadout, AvatarLoadoutPatch, HelixPresenceActivity, DataStoreListPage, LeaderboardPage, LeaderboardSubmitResult, LeaderboardSubmitOptions, LeaderboardTopOptions, DataStoreWriteOptions, DataStoreListOptions, AchievementListResult, AchievementMineResult, MarketplaceListing, MarketplaceQuery, CameraAspect, SavedPhoto, HelixCameraCapability, HelixCameraControl, HelixCameraDroneCommand, HelixCameraDroneState, HelixCameraState, RuntimeFidelityIntent, PackageCustomizerSubject, PackageCustomizerSource, PackageCustomizerContext, DeviceTrialSpawn } from './protocol.js';
|
|
2
|
+
import { HelixMultiplayer } from './multiplayer.js';
|
|
3
|
+
import { HelixVoice } from './voice.js';
|
|
4
|
+
import { HelixMatchmaking, HelixParty } from './matchmaking.js';
|
|
5
|
+
import { CaptureOptions } from './camera.js';
|
|
6
|
+
import type { WorldSpawn } from './universal-vehicles.js';
|
|
7
|
+
export { WorldDeviceHost, deviceRuntimeModuleId as worldDeviceRuntimeModuleId, } from './devices.js';
|
|
8
|
+
export type { DeviceDefinitionReference, DeviceBusBudgetsV1, DeviceAppDefinitionV1, DeviceAppPermissionV1, DeviceAppTypeV1, DeviceBusEnvelopeV1, DeviceDefinitionV1, DevicePortAddressV1, DevicePortAuthorityV1, DevicePortDataTypeV1, DevicePortDirectionV1, DevicePortKindV1, DevicePortV1, DeviceStreamHandleV1, DeviceStreamRoutabilityV1, WorldDeviceDefinitionResolver, WorldDevicePresentation, WorldDevicePresentationAdapter, } from './devices.js';
|
|
9
|
+
export { createSealedDeviceDefinitionResolver, normalizeSealedDeviceDefinitionProjection, } from './device-definition-resolver.js';
|
|
10
|
+
export type { SealedDeviceDefinitionPin, SealedDeviceDefinitionProjection, SealedDeviceDefinitionResolver, SealedDeviceDefinitionResolverOptions, } from './device-definition-resolver.js';
|
|
11
|
+
export type { HelixInteractionPrompt, HelixNotification, HelixNotificationKind, HelixPromptState, HelixDeviceFormFactor, HelixDeviceState, HelixWorldContext, HelixSession, HelixUser, DebugLogEntry, DebugLogLevel, Balance, PurchaseResult, PurchaseStatus, PurchaseContext, PurchaseOptions, ItemEditionMode, AccountVerificationLevel, ProductGrant, Entitlements, ConsumeResult, InventoryItem, EquippedAvatar, AvatarComposition, EquippedEmote, EquippedEmotes, EquippedLocomotionPack, AvatarLoadout, AvatarLoadoutPatch, HelixPresenceActivity, HelixMultiplayerState, HelixMultiplayerRosterEntry, HelixVoiceState, HelixVoiceSettings, HelixVoiceMicMode, HelixVoicePermission, HelixVoiceDevice, DataStoreListPage, DataStoreListPayload, LeaderboardEntry, LeaderboardOrder, LeaderboardPage, LeaderboardSubmitResult, LeaderboardSubmitOptions, LeaderboardTopOptions, DataStoreWriteOptions, DataStoreListOptions, AchievementSummary, AchievementListResult, AchievementMineResult, MarketplaceListing, MarketplaceQuery, CameraAspect, SavedPhoto, CameraSessionState, CameraMediaMode, CameraSpatialMode, CameraControlTarget, CameraLensPreset, CameraFilterId, CameraTimerSeconds, CameraAim, CameraFocusPoint, CameraVector3, CameraDroneLockMode, HelixCameraCapability, HelixCameraShutter, HelixCameraState, HelixCameraControl, HelixCameraDroneTransform, HelixCameraDroneState, HelixCameraDroneCommand, RuntimeFidelityIntent, RuntimeFidelityVisualTier, RuntimeFidelityRenderScale, RuntimeProfileQuality, PackageCustomizerSubject, PackageCustomizerSource, PackageCustomizerContext, DeviceTrialSpawn, } from './protocol.js';
|
|
12
|
+
export { normalizeDeviceTrialSpawn } from './device-trial.js';
|
|
13
|
+
export { CAMERA_LENS_PRESETS, RUNTIME_FIDELITY_VERSION, RUNTIME_FIDELITY_VISUAL_TIERS, RUNTIME_FIDELITY_RENDER_SCALES, RUNTIME_PROFILE_QUALITIES, normalizeRuntimeFidelityIntent, XR_INTERACTION_PROMPT_EVENT, XR_SESSION_EVENT, } from './protocol.js';
|
|
14
|
+
export type { CaptureOptions, CropRect, CameraCapabilityFlag } from './camera.js';
|
|
15
|
+
export { cropRectForAspect, captureCanvas, CAMERA_MIN_ZOOM, CAMERA_MAX_ZOOM, clampCameraZoom, nearestLensPreset, defaultCameraCapability, defaultCameraState, cloneCameraState, cloneCameraCapability, intersectCameraCapability, CAMERA_CAPABILITY_FLAGS, normalizeCameraCapability, normalizeCameraState, validateCameraControl, cameraCapabilityGate, isCameraSessionState, isCameraMediaMode, isCameraSpatialMode, isCameraControlTarget, isCameraFilterId, isCameraTimerSeconds, isCameraDroneLockMode, } from './camera.js';
|
|
16
|
+
export { createMaterialLibrary, createMaterialsNamespace, DEFAULT_MATERIAL_PACK_SLUG, } from './materials.js';
|
|
17
|
+
export type { HelixMaterialCatalog, HelixMaterialDefinition, HelixMaterialKind, HelixMaterialLibrary, HelixMaterialMapPaths, HelixMaterialQuery, HelixMaterialResolutionOption, HelixMaterialResolutionTier, HelixMaterialResolutionVariant, ResolvedHelixMaterial, } from './materials.js';
|
|
18
|
+
export type { HelixRoom, JoinRoomOptions, ReplicaInput } from './multiplayer.js';
|
|
19
|
+
export type { SwitchRoomTarget, SwitchRoomOptions, RoomTicket, HelixRoomJoinErrorCode, HelixRoomLeaveReason } from './multiplayer.js';
|
|
20
|
+
export { HelixRoomJoinError } from './multiplayer.js';
|
|
21
|
+
export { HelixMatchmakingError, HelixPartyError } from './matchmaking.js';
|
|
22
|
+
export type { QueueStatus, QueueWaiting, QueueEndReason, MatchFound, Party, PartyMember, PartyCode, PartyInvite, PartyState, PartyInviteReceipt, HelixMatchmakingErrorCode, HelixPartyErrorCode, } from './matchmaking.js';
|
|
23
|
+
export type { VehiclePackageArtifact, WorldSpawn, ModuleIdentity, ModuleActionRequest, VehicleComponentActionRequest, VehicleDetachActionDescriptor, VehicleDetachActions, VehicleDetachActionRequest, VehicleRole, ModuleStateSnapshot, ModuleEffect, } from './universal-vehicles.js';
|
|
24
|
+
export type { JoinVoiceOptions, HelixVoiceVec3, HelixVoiceAudioFeatures } from './voice.js';
|
|
25
|
+
export { DEFAULT_PUSH_TO_TALK_KEY } from './voice.js';
|
|
26
|
+
export { createVarsView, createRoomAccessors, createModuleAccessors } from './multiplayer-accessors.js';
|
|
27
|
+
export type { VarsView, RoomAccessors, ModuleAccessors, AccessorRoomState, AccessorModuleState } from './multiplayer-accessors.js';
|
|
28
|
+
export { createVaultClient, createVaultLoadPlan, VAULT_ASSET_KINDS, VaultApiError, VaultArtifactUnavailableError, VaultCapabilityUnavailableError, VaultChecksumMismatchError, VaultUnsupportedRuntimeError, } from './vault.js';
|
|
29
|
+
export type { VaultAnimationMetadata, VaultArtifactMetadata, VaultArtifactReference, VaultAssetDetail, VaultAssetHandle, VaultAssetKind, VaultAssetSummary, VaultAssetVersion, VaultAudioGenerationMode, VaultAudioMetadata, VaultCanonicalThumbnail, VaultCharacterMetadata, VaultClient, VaultClientOptions, VaultCompatibility, VaultDecalMetadata, VaultDownloadedArtifact, VaultEnvironmentMetadata, VaultGaussianSplatMetadata, VaultInstallOptions, VaultInstallResult, VaultImmutableArtifactReference, VaultLoadPlan, VaultMaterialMetadata, VaultMetadataByKind, VaultPerformanceMetadata, VaultPerformanceTier, VaultPropMetadata, VaultRankMode, VaultRelatedArtifact, VaultResolvedArtifact, VaultResolvedAsset, VaultRuntime, VaultSceneMetadata, VaultSearchQuery, VaultSearchResult, VaultSelectionExplanation, VaultSkyMetadata, VaultSplatScope, VaultTerrainMetadata, VaultTextureMetadata, VaultUnrealPackageMetadata, VaultVfxMetadata, } from './vault.js';
|
|
30
|
+
export { createDreamerAudioClient, DREAMER_AUDIO_TIMEOUT_MS, DreamerAudioApiError, DreamerAudioCapabilityUnavailableError, DreamerAudioJobFailedError, DreamerAudioJobTimeoutError, DreamerAudioVaultUnavailableError, } from './dreamerAudio.js';
|
|
31
|
+
export { ANY_VERB, ModeStack, bindStackSafety, normaliseTouch, validateInputMap, } from './interaction-mode.js';
|
|
32
|
+
export type { CameraIntent, Capability, InputLeaseHandle, InputLeaseRequest, InputMap, InteractionMode, ModeCapability, ModeContext, ModeEndReason, ModeHost, ModePhase, ModeResult, PushOptions, PushOutcome, StandardModeAction, Suppression, TouchPresentation, TouchPresentationKind, TouchPresentationZone, TouchBinding, TouchKind, VerbBinding, VerbEvent, VerbHandler, VerbPhase, VerbSink, } from './interaction-mode.js';
|
|
33
|
+
export { UniversalActionSurface, createActionSurfaceInputMap, createActionSurfaceMode, validateActionSurfaceSnapshot, } from './action-surface.js';
|
|
34
|
+
export type { ActionSurfaceAction, ActionSurfaceAvailability, ActionSurfaceDevice, ActionSurfaceHintSource, ActionSurfaceInvocation, ActionSurfaceKind, ActionSurfaceModeOptions, ActionSurfaceOption, ActionSurfaceOptionsFrom, ActionSurfaceSnapshot, UniversalActionSurfaceOptions, } from './action-surface.js';
|
|
35
|
+
export type { DreamerAudioArtifact, DreamerAudioClient, DreamerAudioClientOptions, DreamerAudioGenerateRequest, DreamerAudioGenerationMode, DreamerAudioJob, DreamerAudioPendingJob, DreamerAudioPollOptions, DreamerAudioSucceededJob, DreamerAudioFailedJob, DreamerAudioVoiceSettings, DreamerGeneratedVaultAudio, DreamerMusicRequest, DreamerSoundEffectRequest, DreamerTextToSpeechRequest, } from './dreamerAudio.js';
|
|
36
|
+
export * from './multiplayer-contract/index.js';
|
|
37
|
+
export * from './vehicle-specialty-transport.js';
|
|
38
|
+
export * from './vehicle-specialty-placement.js';
|
|
39
|
+
/**
|
|
40
|
+
* A shell-mediated request that failed. `code` classifies it when the shell could —
|
|
41
|
+
* `'version-conflict'` (an optimistic-concurrency clash), `'rate-limited'`, or a Data Store
|
|
42
|
+
* key-policy rule such as `'session-sub-key'` — so a world branches on the code instead of
|
|
43
|
+
* matching error prose. Undefined when the shell is older than the code it would have sent,
|
|
44
|
+
* or the failure has no classification.
|
|
45
|
+
*/
|
|
46
|
+
export declare class HelixRequestError extends Error {
|
|
47
|
+
readonly code?: string;
|
|
48
|
+
constructor(message: string, code?: string);
|
|
49
|
+
}
|
|
3
50
|
export type HelixInitResult = {
|
|
4
51
|
embedded: boolean;
|
|
5
52
|
world: HelixWorldContext | null;
|
|
6
53
|
user: HelixUser | null;
|
|
54
|
+
/**
|
|
55
|
+
* Validated presentation intent frozen by the shell for this World load.
|
|
56
|
+
* Null means an older shell or invalid payload; resolve through engine Auto.
|
|
57
|
+
*/
|
|
58
|
+
runtimeFidelity: RuntimeFidelityIntent | null;
|
|
59
|
+
/** Validated, immutable local package configuration sealed into this trial session. */
|
|
60
|
+
customizerSubject: PackageCustomizerSubject | null;
|
|
61
|
+
/** Trial provenance retained when its subject expires or fails validation. */
|
|
62
|
+
customizerSource: PackageCustomizerSource | null;
|
|
7
63
|
};
|
|
8
64
|
type AuthListener = (user: HelixUser | null) => void;
|
|
65
|
+
type AnalyticsEventName = 'world_entered' | 'world_loaded' | 'world_load_failed' | 'world_exited' | 'world_heartbeat' | 'instance_joined' | 'instance_left' | 'creator_product_viewed' | 'client_error_seen' | 'api_error_seen';
|
|
66
|
+
type AnalyticsTrackInput = {
|
|
67
|
+
eventId?: string;
|
|
68
|
+
instanceId?: string | null;
|
|
69
|
+
itemId?: string | null;
|
|
70
|
+
inviteId?: string | null;
|
|
71
|
+
referrer?: string | null;
|
|
72
|
+
properties?: Record<string, string | number | boolean | null | undefined>;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Result of a listen host admitting one joiner's single-use join token. The player-owned host
|
|
76
|
+
* (profile `listen`) presents the joiner's token + a per-peer connection id; the shell holds the
|
|
77
|
+
* host capability and account JWT and performs the backend consume, returning this correlated result.
|
|
78
|
+
* The host admits the peer's connection ONLY when `admitted` is true.
|
|
79
|
+
*
|
|
80
|
+
* Identity, not seat, is what admission certifies: on `admitted: true` the backend has verified the
|
|
81
|
+
* token and its ListenSeatRecord names the REAL HELIX user behind the join — returned here as
|
|
82
|
+
* `joinerUserId`. That field is REQUIRED when `admitted` is true, and a consuming runtime that
|
|
83
|
+
* receives an admitted receipt without it must FAIL CLOSED: treat the connection as unadmitted and
|
|
84
|
+
* never substitute an assumed identity (a seat id is not a user id). Refused receipts keep their
|
|
85
|
+
* shape — `admitted: false` + `reason?`, never a seatId or joinerUserId.
|
|
86
|
+
*/
|
|
87
|
+
export type ListenAdmissionResult = {
|
|
88
|
+
admitted: boolean;
|
|
89
|
+
seatId?: string;
|
|
90
|
+
joinerUserId?: string;
|
|
91
|
+
reason?: string;
|
|
92
|
+
};
|
|
93
|
+
/** Result of a listen host session heartbeat (session-level; the shell holds the capability). */
|
|
94
|
+
export type ListenHeartbeatResult = {
|
|
95
|
+
status: 'open' | 'closed';
|
|
96
|
+
expiresAt: string;
|
|
97
|
+
};
|
|
98
|
+
/** Result of a listen host closing its session (host departure closes the world; no migration). */
|
|
99
|
+
export type ListenCloseResult = {
|
|
100
|
+
closed: boolean;
|
|
101
|
+
releasedSeatIds: string[];
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Result of a listen host reporting one admitted joiner's departure so the backend frees the seat.
|
|
105
|
+
* The shell authenticates the owning host and addresses the canonical disconnect route; `released`
|
|
106
|
+
* is the backend's verdict for THIS (seatId, connectionId) pair — false when the pair did not match
|
|
107
|
+
* an admission still standing (already departed, wrong connection, or session gone). Not an error:
|
|
108
|
+
* a departed peer is departed, and the host drops the peer either way.
|
|
109
|
+
*/
|
|
110
|
+
export type ListenReleaseResult = {
|
|
111
|
+
released: boolean;
|
|
112
|
+
};
|
|
9
113
|
declare class HelixSdk {
|
|
10
114
|
private shellOrigin;
|
|
11
115
|
private session;
|
|
12
|
-
private
|
|
116
|
+
private worldContext;
|
|
117
|
+
private runtimeFidelityIntent;
|
|
118
|
+
private customizerSubject;
|
|
119
|
+
private customizerSource;
|
|
120
|
+
private deviceTrialSpawn;
|
|
121
|
+
private requestedInstanceId;
|
|
13
122
|
private initialized;
|
|
14
123
|
private listeners;
|
|
124
|
+
private debugEnabled;
|
|
125
|
+
private debugRing;
|
|
126
|
+
private debugListeners;
|
|
127
|
+
private consoleHooked;
|
|
15
128
|
private pendingLogins;
|
|
129
|
+
private pendingRequests;
|
|
130
|
+
private balanceListeners;
|
|
131
|
+
private inventoryListeners;
|
|
132
|
+
private entitlementListeners;
|
|
133
|
+
private avatarListeners;
|
|
134
|
+
private emoteListeners;
|
|
135
|
+
private deviceState;
|
|
136
|
+
private deviceListeners;
|
|
137
|
+
private deviceGlobalShortcutEnabled;
|
|
138
|
+
private cameraState;
|
|
139
|
+
private cameraRuntimeCapability;
|
|
140
|
+
private cameraShellCapability;
|
|
141
|
+
private cameraListeners;
|
|
142
|
+
private autoPurchaseAttempts;
|
|
143
|
+
private left;
|
|
144
|
+
private leaveListeners;
|
|
145
|
+
/** Code-free default material packs resolved from their platform CDN base. */
|
|
146
|
+
readonly materials: {
|
|
147
|
+
load(assetBaseUrl: string): Promise<import("./materials.js").HelixMaterialLibrary>;
|
|
148
|
+
fromCatalog(assetBaseUrl: string, catalog: import("./materials.js").HelixMaterialCatalog): import("./materials.js").HelixMaterialLibrary;
|
|
149
|
+
clearCache(): void;
|
|
150
|
+
};
|
|
151
|
+
/** Authoritative owned item instances currently standing in this World. */
|
|
152
|
+
readonly world: {
|
|
153
|
+
getSpawns: () => Promise<WorldSpawn[]>;
|
|
154
|
+
};
|
|
16
155
|
init(): Promise<HelixInitResult>;
|
|
156
|
+
private readonly serverClock;
|
|
157
|
+
readonly multiplayer: HelixMultiplayer;
|
|
158
|
+
readonly voice: HelixVoice;
|
|
159
|
+
private readonly socialHost;
|
|
160
|
+
readonly party: HelixParty;
|
|
161
|
+
readonly matchmaking: HelixMatchmaking;
|
|
162
|
+
readonly debug: {
|
|
163
|
+
enabled: () => boolean;
|
|
164
|
+
log: (...args: unknown[]) => void;
|
|
165
|
+
onLog: (cb: (entry: DebugLogEntry) => void) => (() => void);
|
|
166
|
+
recent: () => DebugLogEntry[];
|
|
167
|
+
};
|
|
168
|
+
/** Live, read-only access to the current trial customizer projection. */
|
|
169
|
+
readonly customizer: {
|
|
170
|
+
getContext: () => PackageCustomizerContext;
|
|
171
|
+
};
|
|
172
|
+
/** Live, read-only access to the authenticated session's ephemeral Device trial. */
|
|
173
|
+
readonly trial: {
|
|
174
|
+
getDeviceSpawn: () => DeviceTrialSpawn | null;
|
|
175
|
+
};
|
|
17
176
|
readonly auth: {
|
|
18
177
|
getUser: () => Promise<HelixUser | null>;
|
|
19
178
|
isAuthenticated: () => boolean;
|
|
20
179
|
requestLogin: () => Promise<HelixUser>;
|
|
21
180
|
onAuthChanged: (listener: AuthListener) => (() => void);
|
|
22
181
|
};
|
|
182
|
+
readonly notify: {
|
|
183
|
+
show: (notification: HelixNotification) => boolean;
|
|
184
|
+
success: (title: string, message?: string) => boolean;
|
|
185
|
+
failure: (title: string, message?: string) => boolean;
|
|
186
|
+
notification: (title: string, message?: string) => boolean;
|
|
187
|
+
message: (title: string, message?: string) => boolean;
|
|
188
|
+
};
|
|
189
|
+
readonly prompts: {
|
|
190
|
+
set: (prompt: HelixInteractionPrompt) => boolean;
|
|
191
|
+
clear: (promptId?: string) => boolean;
|
|
192
|
+
};
|
|
193
|
+
readonly device: {
|
|
194
|
+
openTablet: () => boolean;
|
|
195
|
+
openPhone: () => boolean;
|
|
196
|
+
/**
|
|
197
|
+
* Enable or disable the SDK-owned Tab shortcut. Enabled by default.
|
|
198
|
+
* An earlier key handler may override one event with `preventDefault()`; a World-level
|
|
199
|
+
* window handler registered after `Helix.init()` should disable this shortcut instead.
|
|
200
|
+
*/
|
|
201
|
+
setGlobalShortcutEnabled: (enabled: boolean) => void;
|
|
202
|
+
getState: () => HelixDeviceState;
|
|
203
|
+
onStateChanged: (cb: (state: HelixDeviceState) => void) => (() => void);
|
|
204
|
+
};
|
|
23
205
|
getSessionToken(): string | null;
|
|
206
|
+
/**
|
|
207
|
+
* True once the player has left this world: the shell's Exit button, the browser's Back off the play page,
|
|
208
|
+
* and, for some worlds, the play page being unloaded (all reach the SDK as helix:leave). From then on the SDK leaves the
|
|
209
|
+
* room and voice, matchmaking and parties stop, and `Helix.multiplayer.joinRoom()` / `switchRoom()` reject
|
|
210
|
+
* with code `left` — whether or not the world held a room when the leave came. A world that runs its own
|
|
211
|
+
* room lifecycle (bot matches, its own rejoin retries) checks this before it rejoins.
|
|
212
|
+
*
|
|
213
|
+
* It stays true for the rest of this world document. The shell never re-enters a world in the same
|
|
214
|
+
* document: entering again is a new iframe document, so a new SDK instance and a new helix:init, which
|
|
215
|
+
* starts at false. The one way the same document comes back is a back/forward-cache restore of the play
|
|
216
|
+
* page (the page is shown again without a new handshake); then this is false again and rooms can be joined.
|
|
217
|
+
*
|
|
218
|
+
* Only the shell that initialised this world can end it: a helix:leave that arrives before helix:init (or
|
|
219
|
+
* from another origin) does not count.
|
|
220
|
+
*/
|
|
221
|
+
hasLeft(): boolean;
|
|
222
|
+
/**
|
|
223
|
+
* Called once, synchronously, when the player leaves this world (see hasLeft(), which is already true by
|
|
224
|
+
* then). A subscriber registered after the leave is not called; read hasLeft() instead. Returns an
|
|
225
|
+
* unsubscribe function. A throwing subscriber is logged and does not stop the others. The subscribers are
|
|
226
|
+
* taken as a snapshot when the leave arrives: unsubscribing another one from inside a callback does not
|
|
227
|
+
* stop it being called for this leave.
|
|
228
|
+
*/
|
|
229
|
+
onLeave(cb: () => void): () => void;
|
|
230
|
+
readonly wallet: {
|
|
231
|
+
getBalance: () => Promise<Balance>;
|
|
232
|
+
onBalanceChanged: (cb: (b: Balance) => void) => (() => void);
|
|
233
|
+
};
|
|
234
|
+
readonly listen: {
|
|
235
|
+
consume: (sessionId: string, listenJoinToken: string, connectionId: string) => Promise<ListenAdmissionResult>;
|
|
236
|
+
release: (sessionId: string, seatId: string, connectionId: string) => Promise<ListenReleaseResult>;
|
|
237
|
+
heartbeat: (sessionId: string) => Promise<ListenHeartbeatResult>;
|
|
238
|
+
close: (sessionId: string) => Promise<ListenCloseResult>;
|
|
239
|
+
};
|
|
240
|
+
readonly marketplace: {
|
|
241
|
+
purchaseProduct: (productKey: string, options?: PurchaseOptions | number) => Promise<PurchaseResult>;
|
|
242
|
+
purchaseDistributionKey: (key: string, options?: PurchaseOptions | number) => Promise<PurchaseResult>;
|
|
243
|
+
purchaseDistribution: (distributionId: string, options?: PurchaseOptions | number) => Promise<PurchaseResult>;
|
|
244
|
+
purchaseListing: (listingId: string, options?: PurchaseOptions) => Promise<PurchaseResult>;
|
|
245
|
+
getPurchase: (idempotencyKey: string, ref?: string) => Promise<PurchaseResult | null>;
|
|
246
|
+
getListings: (query?: MarketplaceQuery) => Promise<MarketplaceListing[]>;
|
|
247
|
+
getPurchaseContext: (ref: string, options?: PurchaseOptions | number) => Promise<PurchaseContext | null>;
|
|
248
|
+
};
|
|
249
|
+
readonly purchases: {
|
|
250
|
+
getEntitlements: () => Promise<Entitlements>;
|
|
251
|
+
consume: (code: string, amount: number) => Promise<ConsumeResult>;
|
|
252
|
+
getPurchase: (idempotencyKey: string, ref?: string) => Promise<PurchaseResult | null>;
|
|
253
|
+
onEntitlementsChanged: (cb: () => void) => (() => void);
|
|
254
|
+
};
|
|
255
|
+
readonly analytics: {
|
|
256
|
+
track: (eventName: AnalyticsEventName, input?: AnalyticsTrackInput) => Promise<void>;
|
|
257
|
+
};
|
|
258
|
+
readonly inventory: {
|
|
259
|
+
hasItem: (itemId: string) => Promise<boolean>;
|
|
260
|
+
getQuantity: (itemId: string) => Promise<number>;
|
|
261
|
+
getMyItems: () => Promise<InventoryItem[]>;
|
|
262
|
+
equipItem: (itemId: string) => Promise<void>;
|
|
263
|
+
onInventoryChanged: (cb: () => void) => (() => void);
|
|
264
|
+
};
|
|
265
|
+
readonly dataStore: {
|
|
266
|
+
get: <T = unknown>(key: string) => Promise<T | null>;
|
|
267
|
+
getEntry: <T = unknown>(key: string) => Promise<{
|
|
268
|
+
value: T;
|
|
269
|
+
version: number;
|
|
270
|
+
} | null>;
|
|
271
|
+
set: <T = unknown>(key: string, value: T, options?: DataStoreWriteOptions) => Promise<void>;
|
|
272
|
+
delete: (key: string, options?: DataStoreWriteOptions) => Promise<void>;
|
|
273
|
+
list: (prefix?: string, opts?: DataStoreListOptions) => Promise<DataStoreListPage>;
|
|
274
|
+
};
|
|
275
|
+
readonly leaderboard: {
|
|
276
|
+
submit: (board: string, score: number, options?: LeaderboardSubmitOptions) => Promise<LeaderboardSubmitResult>;
|
|
277
|
+
top: (board: string, options?: LeaderboardTopOptions) => Promise<LeaderboardPage>;
|
|
278
|
+
};
|
|
279
|
+
readonly achievements: {
|
|
280
|
+
list: () => Promise<AchievementListResult>;
|
|
281
|
+
mine: () => Promise<AchievementMineResult>;
|
|
282
|
+
};
|
|
283
|
+
readonly camera: {
|
|
284
|
+
available: () => boolean;
|
|
285
|
+
capture: (canvas: HTMLCanvasElement, opts?: CaptureOptions) => Promise<Blob>;
|
|
286
|
+
savePhoto: (image: Blob | ArrayBuffer | Uint8Array, meta?: {
|
|
287
|
+
caption?: string;
|
|
288
|
+
aspect?: CameraAspect;
|
|
289
|
+
contentType?: string;
|
|
290
|
+
}) => Promise<SavedPhoto | null>;
|
|
291
|
+
getState: () => HelixCameraState;
|
|
292
|
+
onStateChanged: (cb: (state: HelixCameraState) => void) => (() => void);
|
|
293
|
+
capabilities: () => HelixCameraCapability;
|
|
294
|
+
reportCapability: (capability: HelixCameraCapability) => boolean;
|
|
295
|
+
control: (control: HelixCameraControl) => Promise<HelixCameraState>;
|
|
296
|
+
flyDrone: (command: HelixCameraDroneCommand) => Promise<HelixCameraDroneState>;
|
|
297
|
+
};
|
|
298
|
+
readonly avatar: {
|
|
299
|
+
openCreator: () => Promise<boolean>;
|
|
300
|
+
getLoadout: () => Promise<AvatarLoadout | null>;
|
|
301
|
+
updateLoadout: (patch: AvatarLoadoutPatch) => Promise<AvatarLoadout | null>;
|
|
302
|
+
getEquipped: () => Promise<EquippedAvatar | null>;
|
|
303
|
+
/** Resolve another joined player's public configured avatar for replica rendering. */
|
|
304
|
+
getEquippedForUser: (userId: string) => Promise<EquippedAvatar | null>;
|
|
305
|
+
onAvatarChanged: (cb: () => void) => (() => void);
|
|
306
|
+
};
|
|
307
|
+
readonly emotes: {
|
|
308
|
+
getEquipped: () => Promise<EquippedEmotes | null>;
|
|
309
|
+
/**
|
|
310
|
+
* Fires after the shell has settled and closed an emote-customizer session. A joined room uses the
|
|
311
|
+
* same cue to re-resolve its authoritative seat; a join:false world re-fetches getEquipped instead.
|
|
312
|
+
*/
|
|
313
|
+
onChanged: (cb: () => void) => (() => void);
|
|
314
|
+
/**
|
|
315
|
+
* Raise the platform's emote-wheel customizer over this world.
|
|
316
|
+
*
|
|
317
|
+
* Routed through the `helix:request` bridge, unlike `getEquipped()` above, which deliberately
|
|
318
|
+
* calls the public platform API directly. The difference is that this one CHANGES something and
|
|
319
|
+
* needs the player's own credential: the shell owns the session, so the shell owns the editor.
|
|
320
|
+
* A world can ask for the door to be opened and learns only whether it was.
|
|
321
|
+
*
|
|
322
|
+
* Resolves `false` when the player is signed out (the shell routes them to auth instead) or when
|
|
323
|
+
* the host has no customizer mounted — never throws for either, because "the editor did not open"
|
|
324
|
+
* is a normal outcome a world should handle, not an exception.
|
|
325
|
+
*/
|
|
326
|
+
openCustomizer: () => Promise<boolean>;
|
|
327
|
+
};
|
|
328
|
+
readonly locomotion: {
|
|
329
|
+
/**
|
|
330
|
+
* The locomotion pack the local player MOVES on — read off the seat, not an endpoint.
|
|
331
|
+
*
|
|
332
|
+
* Deliberately unlike `avatar.getEquipped` / `emotes.getEquipped`, which resolve through the shell
|
|
333
|
+
* bridge or a public platform endpoint: a locomotion pack is resolved SERVER-SIDE by the ROOM at join
|
|
334
|
+
* (and re-resolved on the `avatarRefresh` hint) and written onto PlayerState.locomotionPack — contract
|
|
335
|
+
* v34 — so the replicated seat is the only place a client can honestly learn which pack landed on it.
|
|
336
|
+
* Asking the platform directly would answer "what is equipped", which is not the same question as
|
|
337
|
+
* "what is this seat playing".
|
|
338
|
+
*
|
|
339
|
+
* Returns null when there is no seat to read (no room joined, or this session's player has not
|
|
340
|
+
* replicated yet) — the same "could not resolve at all" null its siblings return. An EMPTY `pack` is a
|
|
341
|
+
* real answer: the seat moves on the platform locomotion set, which is equally what a room predating
|
|
342
|
+
* v34, an unresolvable pack and an unservable URL replicate. Never throws.
|
|
343
|
+
*/
|
|
344
|
+
getEquipped: () => Promise<EquippedLocomotionPack | null>;
|
|
345
|
+
};
|
|
346
|
+
readonly presence: {
|
|
347
|
+
setActivity: (activity: HelixPresenceActivity) => Promise<boolean>;
|
|
348
|
+
clearActivity: () => Promise<boolean>;
|
|
349
|
+
};
|
|
350
|
+
private purchase;
|
|
351
|
+
private purchaseQuantity;
|
|
352
|
+
private purchaseAttemptSlot;
|
|
353
|
+
private readPersistedPurchaseAttempts;
|
|
354
|
+
private writePersistedPurchaseAttempts;
|
|
355
|
+
private autoPurchaseKey;
|
|
356
|
+
private clearAutoPurchaseAttempt;
|
|
357
|
+
private settlePurchaseResult;
|
|
358
|
+
private trackAnalytics;
|
|
359
|
+
private safeAnalyticsProperties;
|
|
360
|
+
private openDevice;
|
|
361
|
+
private onKeyDown;
|
|
362
|
+
private isInteractiveUiEvent;
|
|
363
|
+
private request;
|
|
364
|
+
private newId;
|
|
365
|
+
private fetchAvatarLoadout;
|
|
366
|
+
private fetchEquippedAvatar;
|
|
367
|
+
private emitAvatarChanged;
|
|
24
368
|
private snapshot;
|
|
25
369
|
private assertInitialized;
|
|
26
370
|
private waitForInit;
|
|
27
371
|
private onMessage;
|
|
372
|
+
private markLeft;
|
|
373
|
+
private onPageRestored;
|
|
374
|
+
private emitLeave;
|
|
375
|
+
private setDeviceState;
|
|
376
|
+
private setCameraState;
|
|
377
|
+
private effectiveCameraCapability;
|
|
378
|
+
private cameraCapabilityRefusal;
|
|
379
|
+
private adoptShellCameraState;
|
|
28
380
|
private setSession;
|
|
381
|
+
private currentCustomizerContext;
|
|
382
|
+
private enableDebug;
|
|
383
|
+
private hookConsole;
|
|
384
|
+
private notePreview;
|
|
385
|
+
private captureLog;
|
|
29
386
|
private post;
|
|
387
|
+
private postToShell;
|
|
388
|
+
private xrSessionBridgeAttached;
|
|
389
|
+
private attachXrSessionBridge;
|
|
390
|
+
private onXrSession;
|
|
30
391
|
}
|
|
31
392
|
export declare const Helix: HelixSdk;
|