livekit-client 0.18.4-RC6 → 0.18.4

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 (127) hide show
  1. package/README.md +2 -5
  2. package/dist/api/RequestQueue.d.ts +13 -12
  3. package/dist/api/RequestQueue.d.ts.map +1 -0
  4. package/dist/api/SignalClient.d.ts +67 -66
  5. package/dist/api/SignalClient.d.ts.map +1 -0
  6. package/dist/connect.d.ts +24 -23
  7. package/dist/connect.d.ts.map +1 -0
  8. package/dist/index.d.ts +27 -26
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/livekit-client.esm.mjs +546 -486
  11. package/dist/livekit-client.esm.mjs.map +1 -1
  12. package/dist/livekit-client.umd.js +1 -1
  13. package/dist/livekit-client.umd.js.map +1 -1
  14. package/dist/logger.d.ts +26 -25
  15. package/dist/logger.d.ts.map +1 -0
  16. package/dist/options.d.ts +128 -127
  17. package/dist/options.d.ts.map +1 -0
  18. package/dist/proto/google/protobuf/timestamp.d.ts +133 -132
  19. package/dist/proto/google/protobuf/timestamp.d.ts.map +1 -0
  20. package/dist/proto/livekit_models.d.ts +876 -868
  21. package/dist/proto/livekit_models.d.ts.map +1 -0
  22. package/dist/proto/livekit_rtc.d.ts +3904 -3859
  23. package/dist/proto/livekit_rtc.d.ts.map +1 -0
  24. package/dist/room/DeviceManager.d.ts +8 -7
  25. package/dist/room/DeviceManager.d.ts.map +1 -0
  26. package/dist/room/PCTransport.d.ts +16 -15
  27. package/dist/room/PCTransport.d.ts.map +1 -0
  28. package/dist/room/RTCEngine.d.ts +67 -66
  29. package/dist/room/RTCEngine.d.ts.map +1 -0
  30. package/dist/room/Room.d.ts +166 -165
  31. package/dist/room/Room.d.ts.map +1 -0
  32. package/dist/room/errors.d.ts +29 -28
  33. package/dist/room/errors.d.ts.map +1 -0
  34. package/dist/room/events.d.ts +391 -390
  35. package/dist/room/events.d.ts.map +1 -0
  36. package/dist/room/participant/LocalParticipant.d.ts +126 -125
  37. package/dist/room/participant/LocalParticipant.d.ts.map +1 -0
  38. package/dist/room/participant/Participant.d.ts +94 -93
  39. package/dist/room/participant/Participant.d.ts.map +1 -0
  40. package/dist/room/participant/ParticipantTrackPermission.d.ts +26 -19
  41. package/dist/room/participant/ParticipantTrackPermission.d.ts.map +1 -0
  42. package/dist/room/participant/RemoteParticipant.d.ts +40 -39
  43. package/dist/room/participant/RemoteParticipant.d.ts.map +1 -0
  44. package/dist/room/participant/publishUtils.d.ts +18 -17
  45. package/dist/room/participant/publishUtils.d.ts.map +1 -0
  46. package/dist/room/stats.d.ts +66 -65
  47. package/dist/room/stats.d.ts.map +1 -0
  48. package/dist/room/track/LocalAudioTrack.d.ts +20 -19
  49. package/dist/room/track/LocalAudioTrack.d.ts.map +1 -0
  50. package/dist/room/track/LocalTrack.d.ts +28 -27
  51. package/dist/room/track/LocalTrack.d.ts.map +1 -0
  52. package/dist/room/track/LocalTrackPublication.d.ts +38 -37
  53. package/dist/room/track/LocalTrackPublication.d.ts.map +1 -0
  54. package/dist/room/track/LocalVideoTrack.d.ts +31 -30
  55. package/dist/room/track/LocalVideoTrack.d.ts.map +1 -0
  56. package/dist/room/track/RemoteAudioTrack.d.ts +20 -19
  57. package/dist/room/track/RemoteAudioTrack.d.ts.map +1 -0
  58. package/dist/room/track/RemoteTrack.d.ts +16 -15
  59. package/dist/room/track/RemoteTrack.d.ts.map +1 -0
  60. package/dist/room/track/RemoteTrackPublication.d.ts +51 -50
  61. package/dist/room/track/RemoteTrackPublication.d.ts.map +1 -0
  62. package/dist/room/track/RemoteVideoTrack.d.ts +28 -27
  63. package/dist/room/track/RemoteVideoTrack.d.ts.map +1 -0
  64. package/dist/room/track/Track.d.ts +101 -100
  65. package/dist/room/track/Track.d.ts.map +1 -0
  66. package/dist/room/track/TrackPublication.d.ts +50 -49
  67. package/dist/room/track/TrackPublication.d.ts.map +1 -0
  68. package/dist/room/track/create.d.ts +24 -23
  69. package/dist/room/track/create.d.ts.map +1 -0
  70. package/dist/room/track/defaults.d.ts +5 -4
  71. package/dist/room/track/defaults.d.ts.map +1 -0
  72. package/dist/room/track/options.d.ts +223 -222
  73. package/dist/room/track/options.d.ts.map +1 -0
  74. package/dist/room/track/types.d.ts +19 -18
  75. package/dist/room/track/types.d.ts.map +1 -0
  76. package/dist/room/track/utils.d.ts +14 -13
  77. package/dist/room/track/utils.d.ts.map +1 -0
  78. package/dist/room/utils.d.ts +17 -15
  79. package/dist/room/utils.d.ts.map +1 -0
  80. package/dist/test/mocks.d.ts +12 -11
  81. package/dist/test/mocks.d.ts.map +1 -0
  82. package/dist/version.d.ts +3 -2
  83. package/dist/version.d.ts.map +1 -0
  84. package/package.json +4 -5
  85. package/src/api/RequestQueue.ts +53 -0
  86. package/src/api/SignalClient.ts +497 -0
  87. package/src/connect.ts +98 -0
  88. package/src/index.ts +49 -0
  89. package/src/logger.ts +56 -0
  90. package/src/options.ts +156 -0
  91. package/src/proto/google/protobuf/timestamp.ts +216 -0
  92. package/src/proto/livekit_models.ts +2456 -0
  93. package/src/proto/livekit_rtc.ts +2859 -0
  94. package/src/room/DeviceManager.ts +80 -0
  95. package/src/room/PCTransport.ts +88 -0
  96. package/src/room/RTCEngine.ts +695 -0
  97. package/src/room/Room.ts +970 -0
  98. package/src/room/errors.ts +65 -0
  99. package/src/room/events.ts +438 -0
  100. package/src/room/participant/LocalParticipant.ts +755 -0
  101. package/src/room/participant/Participant.ts +287 -0
  102. package/src/room/participant/ParticipantTrackPermission.ts +42 -0
  103. package/src/room/participant/RemoteParticipant.ts +263 -0
  104. package/src/room/participant/publishUtils.test.ts +144 -0
  105. package/src/room/participant/publishUtils.ts +229 -0
  106. package/src/room/stats.ts +134 -0
  107. package/src/room/track/LocalAudioTrack.ts +134 -0
  108. package/src/room/track/LocalTrack.ts +229 -0
  109. package/src/room/track/LocalTrackPublication.ts +87 -0
  110. package/src/room/track/LocalVideoTrack.test.ts +72 -0
  111. package/src/room/track/LocalVideoTrack.ts +295 -0
  112. package/src/room/track/RemoteAudioTrack.ts +86 -0
  113. package/src/room/track/RemoteTrack.ts +62 -0
  114. package/src/room/track/RemoteTrackPublication.ts +207 -0
  115. package/src/room/track/RemoteVideoTrack.ts +240 -0
  116. package/src/room/track/Track.ts +358 -0
  117. package/src/room/track/TrackPublication.ts +120 -0
  118. package/src/room/track/create.ts +122 -0
  119. package/src/room/track/defaults.ts +27 -0
  120. package/src/room/track/options.ts +281 -0
  121. package/src/room/track/types.ts +20 -0
  122. package/src/room/track/utils.test.ts +110 -0
  123. package/src/room/track/utils.ts +113 -0
  124. package/src/room/utils.ts +115 -0
  125. package/src/test/mocks.ts +17 -0
  126. package/src/version.ts +2 -0
  127. package/CHANGELOG.md +0 -5
package/dist/logger.d.ts CHANGED
@@ -1,25 +1,26 @@
1
- export declare enum LogLevel {
2
- trace = 0,
3
- debug = 1,
4
- info = 2,
5
- warn = 3,
6
- error = 4,
7
- silent = 5
8
- }
9
- declare type LogLevelString = keyof typeof LogLevel;
10
- declare type StructuredLogger = {
11
- trace: (msg: string, context?: object) => void;
12
- debug: (msg: string, context?: object) => void;
13
- info: (msg: string, context?: object) => void;
14
- warn: (msg: string, context?: object) => void;
15
- error: (msg: string, context?: object) => void;
16
- };
17
- declare const _default: StructuredLogger;
18
- export default _default;
19
- export declare function setLogLevel(level: LogLevel | LogLevelString): void;
20
- export declare type LogExtension = (level: LogLevel, msg: string, context?: object) => void;
21
- /**
22
- * use this to hook into the logging function to allow sending internal livekit logs to third party services
23
- * if set, the browser logs will lose their stacktrace information (see https://github.com/pimterry/loglevel#writing-plugins)
24
- */
25
- export declare function setLogExtension(extension: LogExtension): void;
1
+ export declare enum LogLevel {
2
+ trace = 0,
3
+ debug = 1,
4
+ info = 2,
5
+ warn = 3,
6
+ error = 4,
7
+ silent = 5
8
+ }
9
+ declare type LogLevelString = keyof typeof LogLevel;
10
+ declare type StructuredLogger = {
11
+ trace: (msg: string, context?: object) => void;
12
+ debug: (msg: string, context?: object) => void;
13
+ info: (msg: string, context?: object) => void;
14
+ warn: (msg: string, context?: object) => void;
15
+ error: (msg: string, context?: object) => void;
16
+ };
17
+ declare const _default: StructuredLogger;
18
+ export default _default;
19
+ export declare function setLogLevel(level: LogLevel | LogLevelString): void;
20
+ export declare type LogExtension = (level: LogLevel, msg: string, context?: object) => void;
21
+ /**
22
+ * use this to hook into the logging function to allow sending internal livekit logs to third party services
23
+ * if set, the browser logs will lose their stacktrace information (see https://github.com/pimterry/loglevel#writing-plugins)
24
+ */
25
+ export declare function setLogExtension(extension: LogExtension): void;
26
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAEA,oBAAY,QAAQ;IAClB,KAAK,IAAI;IACT,KAAK,IAAI;IACT,IAAI,IAAI;IACR,IAAI,IAAI;IACR,KAAK,IAAI;IACT,MAAM,IAAI;CACX;AAED,aAAK,cAAc,GAAG,MAAM,OAAO,QAAQ,CAAC;AAE5C,aAAK,gBAAgB,GAAG;IACtB,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD,CAAC;;AAMF,wBAAiD;AAEjD,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,cAAc,QAE3D;AAED,oBAAY,YAAY,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;AAEpF;;;GAGG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,YAAY,QAkBtD"}
package/dist/options.d.ts CHANGED
@@ -1,127 +1,128 @@
1
- import { LogLevel } from './logger';
2
- import { AudioCaptureOptions, CreateLocalTracksOptions, TrackPublishDefaults, VideoCaptureOptions } from './room/track/options';
3
- import { AdaptiveStreamSettings } from './room/track/types';
4
- /**
5
- * Options for when creating a new room
6
- */
7
- export interface RoomOptions {
8
- /**
9
- * AdaptiveStream lets LiveKit automatically manage quality of subscribed
10
- * video tracks to optimize for bandwidth and CPU.
11
- * When attached video elements are visible, it'll choose an appropriate
12
- * resolution based on the size of largest video element it's attached to.
13
- *
14
- * When none of the video elements are visible, it'll temporarily pause
15
- * the data flow until they are visible again.
16
- */
17
- adaptiveStream?: AdaptiveStreamSettings | boolean;
18
- /**
19
- * enable Dynacast, off by default. With Dynacast dynamically pauses
20
- * video layers that are not being consumed by any subscribers, significantly
21
- * reducing publishing CPU and bandwidth usage.
22
- */
23
- dynacast?: boolean;
24
- /**
25
- * default options to use when capturing user's audio
26
- */
27
- audioCaptureDefaults?: AudioCaptureOptions;
28
- /**
29
- * default options to use when capturing user's video
30
- */
31
- videoCaptureDefaults?: VideoCaptureOptions;
32
- /**
33
- * default options to use when publishing tracks
34
- */
35
- publishDefaults?: TrackPublishDefaults;
36
- /**
37
- * should local tracks be stopped when they are unpublished. defaults to true
38
- * set this to false if you would prefer to clean up unpublished local tracks manually.
39
- */
40
- stopLocalTrackOnUnpublish?: boolean;
41
- /**
42
- * @internal
43
- * experimental flag, introduce a delay before sending signaling messages
44
- */
45
- expSignalLatency?: number;
46
- }
47
- /**
48
- * Options for Room.connect()
49
- */
50
- export interface RoomConnectOptions {
51
- /** autosubscribe to room tracks after joining, defaults to true */
52
- autoSubscribe?: boolean;
53
- /**
54
- * use to override any RTCConfiguration options.
55
- */
56
- rtcConfig?: RTCConfiguration;
57
- /**
58
- * publish only mode
59
- */
60
- publishOnly?: string;
61
- }
62
- /**
63
- * @deprecated use new Room([[RoomOptions]]) and room.connect([[RoomConnectOptions]]) instead
64
- *
65
- * if video or audio tracks are created as part of [[connect]], it'll automatically
66
- * publish those tracks to the room.
67
- */
68
- export interface ConnectOptions extends CreateLocalTracksOptions {
69
- /** autosubscribe to room tracks upon connect, defaults to true */
70
- autoSubscribe?: boolean;
71
- /**
72
- * publish only mode
73
- */
74
- publishOnly?: string;
75
- /**
76
- * see [[RoomOptions.adaptiveStream]]
77
- */
78
- adaptiveStream?: AdaptiveStreamSettings | boolean;
79
- /**
80
- * alias for adaptiveStream
81
- * @deprecated
82
- */
83
- autoManageVideo?: boolean;
84
- /**
85
- * see [[RoomOptions.dynacast]]
86
- */
87
- dynacast?: boolean;
88
- /** configures LiveKit internal log level */
89
- logLevel?: LogLevel;
90
- /**
91
- * set ICE servers. When deployed correctly, LiveKit automatically uses the built-in TURN servers
92
- */
93
- iceServers?: RTCIceServer[];
94
- /**
95
- * use to override any RTCConfiguration options.
96
- */
97
- rtcConfig?: RTCConfiguration;
98
- /**
99
- * capture and publish audio track on connect, defaults to false
100
- *
101
- * If this option is used, you will not be notified if user denies capture permission.
102
- */
103
- audio?: boolean;
104
- /**
105
- * capture and publish video track on connect, defaults to false
106
- *
107
- * If this option is used, you will not be notified if user denies capture permission.
108
- */
109
- video?: boolean;
110
- /**
111
- * default options to use when capturing user's audio
112
- */
113
- audioCaptureDefaults?: AudioCaptureOptions;
114
- /**
115
- * default options to use when capturing user's video
116
- */
117
- videoCaptureDefaults?: VideoCaptureOptions;
118
- /**
119
- * default options to use when publishing tracks
120
- */
121
- publishDefaults?: TrackPublishDefaults;
122
- /**
123
- * should local tracks be stopped when they are unpublished. defaults to true
124
- * set this to false if you would prefer to clean up unpublished local tracks manually.
125
- */
126
- stopLocalTrackOnUnpublish?: boolean;
127
- }
1
+ import { LogLevel } from './logger';
2
+ import { AudioCaptureOptions, CreateLocalTracksOptions, TrackPublishDefaults, VideoCaptureOptions } from './room/track/options';
3
+ import { AdaptiveStreamSettings } from './room/track/types';
4
+ /**
5
+ * Options for when creating a new room
6
+ */
7
+ export interface RoomOptions {
8
+ /**
9
+ * AdaptiveStream lets LiveKit automatically manage quality of subscribed
10
+ * video tracks to optimize for bandwidth and CPU.
11
+ * When attached video elements are visible, it'll choose an appropriate
12
+ * resolution based on the size of largest video element it's attached to.
13
+ *
14
+ * When none of the video elements are visible, it'll temporarily pause
15
+ * the data flow until they are visible again.
16
+ */
17
+ adaptiveStream?: AdaptiveStreamSettings | boolean;
18
+ /**
19
+ * enable Dynacast, off by default. With Dynacast dynamically pauses
20
+ * video layers that are not being consumed by any subscribers, significantly
21
+ * reducing publishing CPU and bandwidth usage.
22
+ */
23
+ dynacast?: boolean;
24
+ /**
25
+ * default options to use when capturing user's audio
26
+ */
27
+ audioCaptureDefaults?: AudioCaptureOptions;
28
+ /**
29
+ * default options to use when capturing user's video
30
+ */
31
+ videoCaptureDefaults?: VideoCaptureOptions;
32
+ /**
33
+ * default options to use when publishing tracks
34
+ */
35
+ publishDefaults?: TrackPublishDefaults;
36
+ /**
37
+ * should local tracks be stopped when they are unpublished. defaults to true
38
+ * set this to false if you would prefer to clean up unpublished local tracks manually.
39
+ */
40
+ stopLocalTrackOnUnpublish?: boolean;
41
+ /**
42
+ * @internal
43
+ * experimental flag, introduce a delay before sending signaling messages
44
+ */
45
+ expSignalLatency?: number;
46
+ }
47
+ /**
48
+ * Options for Room.connect()
49
+ */
50
+ export interface RoomConnectOptions {
51
+ /** autosubscribe to room tracks after joining, defaults to true */
52
+ autoSubscribe?: boolean;
53
+ /**
54
+ * use to override any RTCConfiguration options.
55
+ */
56
+ rtcConfig?: RTCConfiguration;
57
+ /**
58
+ * publish only mode
59
+ */
60
+ publishOnly?: string;
61
+ }
62
+ /**
63
+ * @deprecated use new Room([[RoomOptions]]) and room.connect([[RoomConnectOptions]]) instead
64
+ *
65
+ * if video or audio tracks are created as part of [[connect]], it'll automatically
66
+ * publish those tracks to the room.
67
+ */
68
+ export interface ConnectOptions extends CreateLocalTracksOptions {
69
+ /** autosubscribe to room tracks upon connect, defaults to true */
70
+ autoSubscribe?: boolean;
71
+ /**
72
+ * publish only mode
73
+ */
74
+ publishOnly?: string;
75
+ /**
76
+ * see [[RoomOptions.adaptiveStream]]
77
+ */
78
+ adaptiveStream?: AdaptiveStreamSettings | boolean;
79
+ /**
80
+ * alias for adaptiveStream
81
+ * @deprecated
82
+ */
83
+ autoManageVideo?: boolean;
84
+ /**
85
+ * see [[RoomOptions.dynacast]]
86
+ */
87
+ dynacast?: boolean;
88
+ /** configures LiveKit internal log level */
89
+ logLevel?: LogLevel;
90
+ /**
91
+ * set ICE servers. When deployed correctly, LiveKit automatically uses the built-in TURN servers
92
+ */
93
+ iceServers?: RTCIceServer[];
94
+ /**
95
+ * use to override any RTCConfiguration options.
96
+ */
97
+ rtcConfig?: RTCConfiguration;
98
+ /**
99
+ * capture and publish audio track on connect, defaults to false
100
+ *
101
+ * If this option is used, you will not be notified if user denies capture permission.
102
+ */
103
+ audio?: boolean;
104
+ /**
105
+ * capture and publish video track on connect, defaults to false
106
+ *
107
+ * If this option is used, you will not be notified if user denies capture permission.
108
+ */
109
+ video?: boolean;
110
+ /**
111
+ * default options to use when capturing user's audio
112
+ */
113
+ audioCaptureDefaults?: AudioCaptureOptions;
114
+ /**
115
+ * default options to use when capturing user's video
116
+ */
117
+ videoCaptureDefaults?: VideoCaptureOptions;
118
+ /**
119
+ * default options to use when publishing tracks
120
+ */
121
+ publishDefaults?: TrackPublishDefaults;
122
+ /**
123
+ * should local tracks be stopped when they are unpublished. defaults to true
124
+ * set this to false if you would prefer to clean up unpublished local tracks manually.
125
+ */
126
+ stopLocalTrackOnUnpublish?: boolean;
127
+ }
128
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC;IAElD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,oBAAoB,CAAC,EAAE,mBAAmB,CAAC;IAE3C;;OAEG;IACH,oBAAoB,CAAC,EAAE,mBAAmB,CAAC;IAE3C;;OAEG;IACH,eAAe,CAAC,EAAE,oBAAoB,CAAC;IAEvC;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,mEAAmE;IACnE,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAE7B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAe,SAAQ,wBAAwB;IAC9D,kEAAkE;IAClE,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,cAAc,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC;IAElD;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,YAAY,EAAE,CAAC;IAE5B;;OAEG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAE7B;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,oBAAoB,CAAC,EAAE,mBAAmB,CAAC;IAE3C;;OAEG;IACH,oBAAoB,CAAC,EAAE,mBAAmB,CAAC;IAE3C;;OAEG;IACH,eAAe,CAAC,EAAE,oBAAoB,CAAC;IAEvC;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC"}
@@ -1,132 +1,133 @@
1
- import * as _m0 from 'protobufjs/minimal';
2
- export declare const protobufPackage = "google.protobuf";
3
- /**
4
- * A Timestamp represents a point in time independent of any time zone or local
5
- * calendar, encoded as a count of seconds and fractions of seconds at
6
- * nanosecond resolution. The count is relative to an epoch at UTC midnight on
7
- * January 1, 1970, in the proleptic Gregorian calendar which extends the
8
- * Gregorian calendar backwards to year one.
9
- *
10
- * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
11
- * second table is needed for interpretation, using a [24-hour linear
12
- * smear](https://developers.google.com/time/smear).
13
- *
14
- * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
15
- * restricting to that range, we ensure that we can convert to and from [RFC
16
- * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
17
- *
18
- * # Examples
19
- *
20
- * Example 1: Compute Timestamp from POSIX `time()`.
21
- *
22
- * Timestamp timestamp;
23
- * timestamp.set_seconds(time(NULL));
24
- * timestamp.set_nanos(0);
25
- *
26
- * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
27
- *
28
- * struct timeval tv;
29
- * gettimeofday(&tv, NULL);
30
- *
31
- * Timestamp timestamp;
32
- * timestamp.set_seconds(tv.tv_sec);
33
- * timestamp.set_nanos(tv.tv_usec * 1000);
34
- *
35
- * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
36
- *
37
- * FILETIME ft;
38
- * GetSystemTimeAsFileTime(&ft);
39
- * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
40
- *
41
- * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
42
- * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
43
- * Timestamp timestamp;
44
- * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
45
- * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
46
- *
47
- * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
48
- *
49
- * long millis = System.currentTimeMillis();
50
- *
51
- * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
52
- * .setNanos((int) ((millis % 1000) * 1000000)).build();
53
- *
54
- *
55
- * Example 5: Compute Timestamp from Java `Instant.now()`.
56
- *
57
- * Instant now = Instant.now();
58
- *
59
- * Timestamp timestamp =
60
- * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
61
- * .setNanos(now.getNano()).build();
62
- *
63
- *
64
- * Example 6: Compute Timestamp from current time in Python.
65
- *
66
- * timestamp = Timestamp()
67
- * timestamp.GetCurrentTime()
68
- *
69
- * # JSON Mapping
70
- *
71
- * In JSON format, the Timestamp type is encoded as a string in the
72
- * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
73
- * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
74
- * where {year} is always expressed using four digits while {month}, {day},
75
- * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
76
- * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
77
- * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
78
- * is required. A proto3 JSON serializer should always use UTC (as indicated by
79
- * "Z") when printing the Timestamp type and a proto3 JSON parser should be
80
- * able to accept both UTC and other timezones (as indicated by an offset).
81
- *
82
- * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
83
- * 01:30 UTC on January 15, 2017.
84
- *
85
- * In JavaScript, one can convert a Date object to this format using the
86
- * standard
87
- * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
88
- * method. In Python, a standard `datetime.datetime` object can be converted
89
- * to this format using
90
- * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
91
- * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
92
- * the Joda Time's [`ISODateTimeFormat.dateTime()`](
93
- * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
94
- * ) to obtain a formatter capable of generating timestamps in this format.
95
- */
96
- export interface Timestamp {
97
- /**
98
- * Represents seconds of UTC time since Unix epoch
99
- * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
100
- * 9999-12-31T23:59:59Z inclusive.
101
- */
102
- seconds: number;
103
- /**
104
- * Non-negative fractions of a second at nanosecond resolution. Negative
105
- * second values with fractions must still have non-negative nanos values
106
- * that count forward in time. Must be from 0 to 999,999,999
107
- * inclusive.
108
- */
109
- nanos: number;
110
- }
111
- export declare const Timestamp: {
112
- encode(message: Timestamp, writer?: _m0.Writer): _m0.Writer;
113
- decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Timestamp;
114
- fromJSON(object: any): Timestamp;
115
- toJSON(message: Timestamp): unknown;
116
- fromPartial<I extends {
117
- seconds?: number | undefined;
118
- nanos?: number | undefined;
119
- } & {
120
- seconds?: number | undefined;
121
- nanos?: number | undefined;
122
- } & Record<Exclude<keyof I, keyof Timestamp>, never>>(object: I): Timestamp;
123
- };
124
- declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
125
- export declare type DeepPartial<T> = T extends Builtin ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
126
- [K in keyof T]?: DeepPartial<T[K]>;
127
- } : Partial<T>;
128
- declare type KeysOfUnion<T> = T extends T ? keyof T : never;
129
- export declare type Exact<P, I extends P> = P extends Builtin ? P : P & {
130
- [K in keyof P]: Exact<P[K], I[K]>;
131
- } & Record<Exclude<keyof I, KeysOfUnion<P>>, never>;
132
- export {};
1
+ import * as _m0 from 'protobufjs/minimal';
2
+ export declare const protobufPackage = "google.protobuf";
3
+ /**
4
+ * A Timestamp represents a point in time independent of any time zone or local
5
+ * calendar, encoded as a count of seconds and fractions of seconds at
6
+ * nanosecond resolution. The count is relative to an epoch at UTC midnight on
7
+ * January 1, 1970, in the proleptic Gregorian calendar which extends the
8
+ * Gregorian calendar backwards to year one.
9
+ *
10
+ * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
11
+ * second table is needed for interpretation, using a [24-hour linear
12
+ * smear](https://developers.google.com/time/smear).
13
+ *
14
+ * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
15
+ * restricting to that range, we ensure that we can convert to and from [RFC
16
+ * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
17
+ *
18
+ * # Examples
19
+ *
20
+ * Example 1: Compute Timestamp from POSIX `time()`.
21
+ *
22
+ * Timestamp timestamp;
23
+ * timestamp.set_seconds(time(NULL));
24
+ * timestamp.set_nanos(0);
25
+ *
26
+ * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
27
+ *
28
+ * struct timeval tv;
29
+ * gettimeofday(&tv, NULL);
30
+ *
31
+ * Timestamp timestamp;
32
+ * timestamp.set_seconds(tv.tv_sec);
33
+ * timestamp.set_nanos(tv.tv_usec * 1000);
34
+ *
35
+ * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
36
+ *
37
+ * FILETIME ft;
38
+ * GetSystemTimeAsFileTime(&ft);
39
+ * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
40
+ *
41
+ * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
42
+ * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
43
+ * Timestamp timestamp;
44
+ * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
45
+ * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
46
+ *
47
+ * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
48
+ *
49
+ * long millis = System.currentTimeMillis();
50
+ *
51
+ * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
52
+ * .setNanos((int) ((millis % 1000) * 1000000)).build();
53
+ *
54
+ *
55
+ * Example 5: Compute Timestamp from Java `Instant.now()`.
56
+ *
57
+ * Instant now = Instant.now();
58
+ *
59
+ * Timestamp timestamp =
60
+ * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
61
+ * .setNanos(now.getNano()).build();
62
+ *
63
+ *
64
+ * Example 6: Compute Timestamp from current time in Python.
65
+ *
66
+ * timestamp = Timestamp()
67
+ * timestamp.GetCurrentTime()
68
+ *
69
+ * # JSON Mapping
70
+ *
71
+ * In JSON format, the Timestamp type is encoded as a string in the
72
+ * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
73
+ * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
74
+ * where {year} is always expressed using four digits while {month}, {day},
75
+ * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
76
+ * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
77
+ * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
78
+ * is required. A proto3 JSON serializer should always use UTC (as indicated by
79
+ * "Z") when printing the Timestamp type and a proto3 JSON parser should be
80
+ * able to accept both UTC and other timezones (as indicated by an offset).
81
+ *
82
+ * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
83
+ * 01:30 UTC on January 15, 2017.
84
+ *
85
+ * In JavaScript, one can convert a Date object to this format using the
86
+ * standard
87
+ * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
88
+ * method. In Python, a standard `datetime.datetime` object can be converted
89
+ * to this format using
90
+ * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
91
+ * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
92
+ * the Joda Time's [`ISODateTimeFormat.dateTime()`](
93
+ * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
94
+ * ) to obtain a formatter capable of generating timestamps in this format.
95
+ */
96
+ export interface Timestamp {
97
+ /**
98
+ * Represents seconds of UTC time since Unix epoch
99
+ * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
100
+ * 9999-12-31T23:59:59Z inclusive.
101
+ */
102
+ seconds: number;
103
+ /**
104
+ * Non-negative fractions of a second at nanosecond resolution. Negative
105
+ * second values with fractions must still have non-negative nanos values
106
+ * that count forward in time. Must be from 0 to 999,999,999
107
+ * inclusive.
108
+ */
109
+ nanos: number;
110
+ }
111
+ export declare const Timestamp: {
112
+ encode(message: Timestamp, writer?: _m0.Writer): _m0.Writer;
113
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Timestamp;
114
+ fromJSON(object: any): Timestamp;
115
+ toJSON(message: Timestamp): unknown;
116
+ fromPartial<I extends {
117
+ seconds?: number | undefined;
118
+ nanos?: number | undefined;
119
+ } & {
120
+ seconds?: number | undefined;
121
+ nanos?: number | undefined;
122
+ } & Record<Exclude<keyof I, keyof Timestamp>, never>>(object: I): Timestamp;
123
+ };
124
+ declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
125
+ export declare type DeepPartial<T> = T extends Builtin ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
126
+ [K in keyof T]?: DeepPartial<T[K]>;
127
+ } : Partial<T>;
128
+ declare type KeysOfUnion<T> = T extends T ? keyof T : never;
129
+ export declare type Exact<P, I extends P> = P extends Builtin ? P : P & {
130
+ [K in keyof P]: Exact<P[K], I[K]>;
131
+ } & Record<Exclude<keyof I, KeysOfUnion<P>>, never>;
132
+ export {};
133
+ //# sourceMappingURL=timestamp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timestamp.d.ts","sourceRoot":"","sources":["../../../../src/proto/google/protobuf/timestamp.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAE1C,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4FG;AACH,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAMD,eAAO,MAAM,SAAS;oBACJ,SAAS,WAAU,IAAI,MAAM,GAAyB,IAAI,MAAM;kBAUlE,IAAI,MAAM,GAAG,UAAU,gCAAoB,SAAS;qBAqBjD,GAAG,GAAG,SAAS;oBAOhB,SAAS,GAAG,OAAO;;;;;;;sEAOiC,SAAS;CAM9E,CAAC;AAaF,aAAK,OAAO,GAAG,IAAI,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEpF,oBAAY,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,GAC1C,CAAC,GACD,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GACxB,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GACrB,CAAC,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAChC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAC7B,CAAC,SAAS,EAAE,GACZ;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACtC,OAAO,CAAC,CAAC,CAAC,CAAC;AAEf,aAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC;AACpD,oBAAY,KAAK,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,OAAO,GACjD,CAAC,GACD,CAAC,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC"}