@await-widget/runtime 0.0.46 → 0.0.48

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.
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  /* eslint-disable n/prefer-global/buffer, no-bitwise, unicorn/no-array-sort */
3
3
  import crypto from 'node:crypto';
4
+ import {execFileSync} from 'node:child_process';
4
5
  import fs from 'node:fs';
5
6
  import http from 'node:http';
6
7
  import os from 'node:os';
@@ -921,6 +922,10 @@ function printServerUrls(port, token) {
921
922
  console.log('');
922
923
  console.log(recommended.url);
923
924
  console.log('');
925
+ if (process.platform === 'darwin') {
926
+ execFileSync('pbcopy', {input: recommended.url});
927
+ console.log('Connection URL copied to clipboard.');
928
+ }
924
929
  }
925
930
 
926
931
  if (otherUrls.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@await-widget/runtime",
3
- "version": "0.0.46",
3
+ "version": "0.0.48",
4
4
  "description": "TypeScript declarations for Await widgets.",
5
5
  "license": "MIT",
6
6
  "author": "Maundy",
package/types/await.d.ts CHANGED
@@ -76,7 +76,7 @@ declare module 'await' {
76
76
  children?: NativeView;
77
77
  },
78
78
  ): NativeView;
79
- /** Displays an automatically updating clock or countdown. */
79
+ /** Displays an automatically updating clock, countdown/count-up timer, or stopwatch. */
80
80
  export function Time(
81
81
  props: TimeValue &
82
82
  ID &
package/types/prop.d.ts CHANGED
@@ -146,6 +146,30 @@ type IconValue = {
146
146
  resizable?: Resizable;
147
147
  };
148
148
 
149
+ /** Unbounded stopwatch counts up from `date` */
150
+ type TimeStopwatchFormat = {
151
+ type: 'stopwatch';
152
+ /** Whether to include an hours component. Default true. */
153
+ showsHours?: boolean;
154
+ /** Maximum number of time fields to display. Default 4. */
155
+ maxFieldCount?: number;
156
+ /** Smallest displayed unit in seconds, e.g. 0.01. Default 0.01. */
157
+ maxPrecision?: number;
158
+ };
159
+
160
+ /** Bounded timer stops at `date` */
161
+ type TimeTimerFormat = {
162
+ type: 'timer';
163
+ /** Counts down to `date` when true, counts up to it when false. Default true. */
164
+ countsDown?: boolean;
165
+ /** Whether to include an hours component. Default true. */
166
+ showsHours?: boolean;
167
+ /** Clamped to 2...4. Default 3. */
168
+ maxFieldCount?: number;
169
+ /** Smallest displayed unit in seconds: 0.01 (hundredths), 0.1 (tenths), or 1 (seconds). Default 1. */
170
+ maxPrecision?: 0.01 | 0.1 | 1;
171
+ };
172
+
149
173
  type TimeValue =
150
174
  | {
151
175
  /** IANA time-zone identifier. Omit to use the system time zone. */
@@ -155,22 +179,38 @@ type TimeValue =
155
179
  style?: never;
156
180
  countsDown?: never;
157
181
  showsHours?: never;
182
+ maxFieldCount?: never;
183
+ maxPrecision?: never;
158
184
  }
159
185
  | {
160
186
  date?: Date;
161
- style?: TimeStyle;
187
+ format: TimeStopwatchFormat;
162
188
  timeZone?: never;
163
- format?: never;
189
+ style?: never;
190
+ countsDown?: never;
191
+ showsHours?: never;
192
+ maxFieldCount?: never;
193
+ maxPrecision?: never;
194
+ }
195
+ | {
196
+ date: Date;
197
+ format: TimeTimerFormat;
198
+ timeZone?: never;
199
+ style?: never;
164
200
  countsDown?: never;
165
201
  showsHours?: never;
202
+ maxFieldCount?: never;
203
+ maxPrecision?: never;
166
204
  }
167
205
  | {
168
206
  date?: Date;
169
- countsDown?: boolean;
170
- showsHours?: boolean;
207
+ style?: TimeStyle;
171
208
  timeZone?: never;
172
209
  format?: never;
173
- style?: never;
210
+ countsDown?: never;
211
+ showsHours?: never;
212
+ maxFieldCount?: never;
213
+ maxPrecision?: never;
174
214
  };
175
215
 
176
216
  type ProgressViewValue = {