@ziztechnology/dial-library 0.0.15 → 0.0.17
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 +382 -250
- package/dist/index.d.mts +132 -3
- package/dist/index.mjs +815 -432
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -379,14 +379,86 @@ interface DrivingStatusControllerOptions {
|
|
|
379
379
|
/** Pause on Runtime/visibility/page hooks and resume only if start() is still requested. */
|
|
380
380
|
managePageLifecycle?: boolean;
|
|
381
381
|
}
|
|
382
|
-
|
|
382
|
+
declare const createDrivingStatusController: (options?: DrivingStatusControllerOptions) => DrivingStatusController;
|
|
383
|
+
declare class DrivingStatusController {
|
|
384
|
+
private readonly sensorProvider;
|
|
385
|
+
private readonly pollIntervalMs;
|
|
386
|
+
private readonly unavailableFallbackMs;
|
|
387
|
+
private readonly tuning;
|
|
388
|
+
private readonly directionalLongitudinalTuning;
|
|
389
|
+
private readonly clock;
|
|
390
|
+
private readonly onDiagnostic?;
|
|
391
|
+
private readonly managePageLifecycle;
|
|
392
|
+
private readonly listeners;
|
|
393
|
+
private readonly longitudinalWindow;
|
|
394
|
+
private readonly yawWindow;
|
|
395
|
+
private readonly motionWindow;
|
|
396
|
+
private status;
|
|
397
|
+
private baseStatus;
|
|
398
|
+
private candidate;
|
|
399
|
+
private candidateSinceMs;
|
|
400
|
+
private statusCommittedAtMs;
|
|
401
|
+
private lastAvailableAtMs;
|
|
402
|
+
private unavailableSinceMs;
|
|
403
|
+
private fallbackApplied;
|
|
404
|
+
private filteredGravity;
|
|
405
|
+
private rawGravity;
|
|
406
|
+
private lastGravitySampledAtMs;
|
|
407
|
+
private linearAccelerationBias;
|
|
408
|
+
private gyroscopeBias;
|
|
409
|
+
private biasCalibrated;
|
|
410
|
+
private lastBiasSampledAtMs;
|
|
411
|
+
private stoppedConditionSinceMs;
|
|
412
|
+
private drivingConditionSinceMs;
|
|
413
|
+
private stationaryConfirmed;
|
|
414
|
+
private urgentStatus;
|
|
415
|
+
private urgentStartedAtMs;
|
|
416
|
+
private normalLongitudinalStatus;
|
|
417
|
+
private longitudinalClearSinceMs;
|
|
418
|
+
private turnStatus;
|
|
419
|
+
private turnQuietSinceMs;
|
|
420
|
+
private oppositeTurnSinceMs;
|
|
421
|
+
private readonly detectorCandidates;
|
|
422
|
+
private readonly detectorRejections;
|
|
423
|
+
private requestedRunning;
|
|
424
|
+
private polling;
|
|
425
|
+
private lifecycleSuspended;
|
|
426
|
+
private destroyed;
|
|
427
|
+
private generation;
|
|
428
|
+
private timer;
|
|
429
|
+
private pendingRead;
|
|
430
|
+
private unsubscribePageLifecycle;
|
|
431
|
+
constructor(options?: DrivingStatusControllerOptions);
|
|
383
432
|
start(): void;
|
|
384
433
|
stop(): void;
|
|
385
434
|
destroy(): void;
|
|
386
435
|
getSnapshot(): DrivingControllerSnapshot;
|
|
387
436
|
subscribe(listener: (event: DrivingStatusEvent) => void): () => void;
|
|
437
|
+
private activatePolling;
|
|
438
|
+
private deactivatePolling;
|
|
439
|
+
private schedulePoll;
|
|
440
|
+
private poll;
|
|
441
|
+
private resolveGravityFrame;
|
|
442
|
+
private processAvailable;
|
|
443
|
+
private updateBaseDetector;
|
|
444
|
+
private updateLongitudinalDetector;
|
|
445
|
+
private updateTurnDetector;
|
|
446
|
+
private updateBias;
|
|
447
|
+
private updateDetectorCandidate;
|
|
448
|
+
private emitDetectorConfirmation;
|
|
449
|
+
private emitDetectorTransition;
|
|
450
|
+
private commitSelectedStatus;
|
|
451
|
+
private processUnavailable;
|
|
452
|
+
private commit;
|
|
453
|
+
private setCandidate;
|
|
454
|
+
private clearRecognitionWindows;
|
|
455
|
+
private resetTransientRecognition;
|
|
456
|
+
private emitDiagnostic;
|
|
457
|
+
private attachLifecycleListeners;
|
|
458
|
+
private detachLifecycleListeners;
|
|
459
|
+
private readonly handleLifecyclePause;
|
|
460
|
+
private readonly handleLifecycleResume;
|
|
388
461
|
}
|
|
389
|
-
declare const createDrivingStatusController: (options?: DrivingStatusControllerOptions) => DrivingStatusController;
|
|
390
462
|
//#endregion
|
|
391
463
|
//#region src/driving_expression/driving_expression_player.d.ts
|
|
392
464
|
type DrivingExpressionPlayerErrorCategory = 'invalid_config' | 'network' | 'timeout' | 'decode' | 'unsupported';
|
|
@@ -440,4 +512,61 @@ interface DrivingExpressionPlayer {
|
|
|
440
512
|
}
|
|
441
513
|
declare const createDrivingExpressionPlayer: (container: HTMLElement, options: DrivingExpressionPlayerOptions) => DrivingExpressionPlayer;
|
|
442
514
|
//#endregion
|
|
443
|
-
|
|
515
|
+
//#region src/multimedia/multimedia_controller.d.ts
|
|
516
|
+
interface MultimediaPlayerState {
|
|
517
|
+
isPlaying: boolean;
|
|
518
|
+
title: string;
|
|
519
|
+
artist: string;
|
|
520
|
+
canNext: boolean;
|
|
521
|
+
canPrevious: boolean;
|
|
522
|
+
}
|
|
523
|
+
type MultimediaControlResult = void | PromiseLike<void>;
|
|
524
|
+
interface MultimediaPlayerControls {
|
|
525
|
+
play(): MultimediaControlResult;
|
|
526
|
+
pause(): MultimediaControlResult;
|
|
527
|
+
toggle?(): MultimediaControlResult;
|
|
528
|
+
next?(): MultimediaControlResult;
|
|
529
|
+
previous?(): MultimediaControlResult;
|
|
530
|
+
seekToMs?(positionMs: number): MultimediaControlResult;
|
|
531
|
+
}
|
|
532
|
+
interface MultimediaControllerOptions {
|
|
533
|
+
getState(): MultimediaPlayerState;
|
|
534
|
+
controls: MultimediaPlayerControls;
|
|
535
|
+
reportIntervalMs?: number;
|
|
536
|
+
}
|
|
537
|
+
type MultimediaBridgeErrorCode = 'MULTIMEDIA_BRIDGE_CONFLICT' | 'MULTIMEDIA_BRIDGE_INITIALIZATION_FAILED';
|
|
538
|
+
declare class MultimediaBridgeError extends Error {
|
|
539
|
+
readonly code: MultimediaBridgeErrorCode;
|
|
540
|
+
readonly cause: unknown;
|
|
541
|
+
constructor(code: MultimediaBridgeErrorCode, message: string, cause?: unknown);
|
|
542
|
+
}
|
|
543
|
+
declare const createMultimediaController: (options: MultimediaControllerOptions) => MultimediaController;
|
|
544
|
+
declare class MultimediaController {
|
|
545
|
+
private readonly runtimeWindow;
|
|
546
|
+
private readonly getStateProvider;
|
|
547
|
+
private readonly controls;
|
|
548
|
+
private readonly reportIntervalMs;
|
|
549
|
+
private readonly runtimeBridge;
|
|
550
|
+
private readonly bridgeInstanceId;
|
|
551
|
+
private reportTimer;
|
|
552
|
+
private bridgeProtocol;
|
|
553
|
+
private lastKnownState;
|
|
554
|
+
private destroyed;
|
|
555
|
+
constructor(options: MultimediaControllerOptions);
|
|
556
|
+
reportState(): boolean;
|
|
557
|
+
destroy(): void;
|
|
558
|
+
private readonly handleMediaCommand;
|
|
559
|
+
private readonly handleMediaStateRequest;
|
|
560
|
+
private assertOptions;
|
|
561
|
+
private readState;
|
|
562
|
+
private reportInitialState;
|
|
563
|
+
private dispatchControl;
|
|
564
|
+
private syncHeartbeat;
|
|
565
|
+
private stopHeartbeat;
|
|
566
|
+
private cleanupInstalledResources;
|
|
567
|
+
private closeNativeBridge;
|
|
568
|
+
private reportFailure;
|
|
569
|
+
private isMultimediaCommand;
|
|
570
|
+
}
|
|
571
|
+
//#endregion
|
|
572
|
+
export { AvailableSensorMetric, BATTERY_HEALTH_LABELS, BatteryCapacityValue, BatteryHealth, BatteryPlugged, BatteryStateValue, BatteryStatus, CAR_RUNNING_LABELS, CAR_RUNNING_STATUSES, CAR_RUNNING_STATUS_PRIORITY, CarRunningStatus, CompleteDrivingExpressionsConfig, DEFAULT_DRIVING_STATUS_TUNING, DrivingBaseDetectorStatistics, DrivingControllerSnapshot, DrivingDetectorName, DrivingDetectorRejectionReason, DrivingDetectorStatistics, DrivingDetectorTransitionPhase, DrivingExpressionMedia, DrivingExpressionPlayer, DrivingExpressionPlayerDiagnosticEvent, DrivingExpressionPlayerErrorCategory, DrivingExpressionPlayerOptions, DrivingExpressionPlayerSnapshot, DrivingExpressionResolutionError, DrivingExpressionsConfig, DrivingExpressionsConfigError, DrivingExpressionsConfigErrorCode, DrivingExpressionsConfigInput, DrivingFrameSource, DrivingLongitudinalWindowStatistics, DrivingMetricsCorrection, DrivingRapidLongitudinalStatistics, DrivingSensorProvider, DrivingSnapshotAnalysis, DrivingSnapshotCandidate, DrivingSnapshotMetrics, DrivingSnapshotRejectionReason, DrivingStatusChangeReason, DrivingStatusClock, DrivingStatusController, DrivingStatusControllerOptions, DrivingStatusDiagnosticEvent, DrivingStatusEvent, DrivingStatusTuning, DrivingStatusTuningOverrides, DrivingTurnDetectorStatistics, DrivingVehicleFrame, EmojiDrivingExpressionMedia, ImageDrivingExpressionMedia, LivePhotoDrivingExpressionMedia, MediaLibraryRef, MultimediaBridgeError, MultimediaBridgeErrorCode, MultimediaControlResult, MultimediaController, MultimediaControllerOptions, MultimediaPlayerControls, MultimediaPlayerState, OFFICIAL_DRIVING_EXPRESSIONS_CONFIG, OFFICIAL_DRIVING_EXPRESSION_FALLBACKS, OrientationValue, ParseDrivingExpressionsOptions, StructuredDrivingExpressionMedia, TgsDrivingExpressionMedia, UnavailableSensorMetric, UnifiedSensorInfoPayload, UnifiedSensorMetric, UnifiedSensorUnavailableReason, Vector3Value, VideoDrivingExpressionMedia, WaitForDrivingExpressionsConfigOptions, buildVehicleFrame, classifyDrivingSnapshot, createDrivingExpressionPlayer, createDrivingStatusController, createMultimediaController, extractDrivingSnapshotMetrics, isPublicDrivingMediaUrl, parseDrivingExpressionsConfig, readDrivingExpressionsConfig, resolveDrivingExpression, resolveDrivingExpressionStrict, resolveDrivingStatusTuning, tryParseDrivingExpressionsConfig, unifiedSensorInfo, waitForDrivingExpressionsConfig };
|