@encore.dev/sdk 2.0.0-beta.15 → 2.0.0-beta.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.
Files changed (235) hide show
  1. package/README.md +111 -101
  2. package/app_meta.ts +56 -54
  3. package/config/config.ts +60 -57
  4. package/config/secrets.ts +45 -52
  5. package/config/value.ts +23 -26
  6. package/cron/mod.ts +28 -29
  7. package/dist/app_meta.d.ts +52 -50
  8. package/dist/app_meta.d.ts.map +1 -1
  9. package/dist/app_meta.js +2 -2
  10. package/dist/app_meta.js.map +1 -1
  11. package/dist/config/config.d.ts +58 -55
  12. package/dist/config/config.d.ts.map +1 -1
  13. package/dist/config/config.js +8 -9
  14. package/dist/config/config.js.map +1 -1
  15. package/dist/config/secrets.d.ts +45 -52
  16. package/dist/config/secrets.d.ts.map +1 -1
  17. package/dist/config/secrets.js +8 -9
  18. package/dist/config/secrets.js.map +1 -1
  19. package/dist/config/value.d.ts +20 -23
  20. package/dist/config/value.d.ts.map +1 -1
  21. package/dist/config/value.js +20 -23
  22. package/dist/config/value.js.map +1 -1
  23. package/dist/cron/mod.d.ts +26 -27
  24. package/dist/cron/mod.d.ts.map +1 -1
  25. package/dist/cron/mod.js +13 -14
  26. package/dist/cron/mod.js.map +1 -1
  27. package/dist/frontends/mod.d.ts +20 -19
  28. package/dist/frontends/mod.d.ts.map +1 -1
  29. package/dist/frontends/mod.js +20 -19
  30. package/dist/frontends/mod.js.map +1 -1
  31. package/dist/gateway/errors.d.ts +28 -30
  32. package/dist/gateway/errors.d.ts.map +1 -1
  33. package/dist/gateway/errors.js +29 -31
  34. package/dist/gateway/errors.js.map +1 -1
  35. package/dist/gateway/match.d.ts +54 -54
  36. package/dist/gateway/match.d.ts.map +1 -1
  37. package/dist/gateway/match.js +56 -56
  38. package/dist/gateway/match.js.map +1 -1
  39. package/dist/gateway/middleware.d.ts +62 -64
  40. package/dist/gateway/middleware.d.ts.map +1 -1
  41. package/dist/gateway/middleware.js +1 -1
  42. package/dist/gateway/middleware.js.map +1 -1
  43. package/dist/gateway/mod.d.ts +64 -67
  44. package/dist/gateway/mod.d.ts.map +1 -1
  45. package/dist/gateway/mod.js +72 -76
  46. package/dist/gateway/mod.js.map +1 -1
  47. package/dist/gateway/request.d.ts +138 -134
  48. package/dist/gateway/request.d.ts.map +1 -1
  49. package/dist/gateway/request.js +117 -108
  50. package/dist/gateway/request.js.map +1 -1
  51. package/dist/gateway/serve.d.ts +29 -34
  52. package/dist/gateway/serve.d.ts.map +1 -1
  53. package/dist/gateway/serve.js +51 -56
  54. package/dist/gateway/serve.js.map +1 -1
  55. package/dist/gateways/mod.d.ts +23 -21
  56. package/dist/gateways/mod.d.ts.map +1 -1
  57. package/dist/gateways/mod.js +25 -23
  58. package/dist/gateways/mod.js.map +1 -1
  59. package/dist/internal/runtime/napi/napi.cjs +1 -1
  60. package/dist/internal/runtime/napi/napi.d.cts +10 -3
  61. package/dist/internal/runtime/shutdown.d.ts +75 -57
  62. package/dist/internal/runtime/shutdown.d.ts.map +1 -1
  63. package/dist/internal/runtime/shutdown.js +88 -84
  64. package/dist/internal/runtime/shutdown.js.map +1 -1
  65. package/dist/log/logger.d.ts +43 -37
  66. package/dist/log/logger.d.ts.map +1 -1
  67. package/dist/log/logger.js +26 -25
  68. package/dist/log/logger.js.map +1 -1
  69. package/dist/metrics/mod.d.ts +133 -114
  70. package/dist/metrics/mod.d.ts.map +1 -1
  71. package/dist/metrics/mod.js +109 -101
  72. package/dist/metrics/mod.js.map +1 -1
  73. package/dist/otel.d.ts +6 -3
  74. package/dist/otel.d.ts.map +1 -1
  75. package/dist/otel.js +6 -3
  76. package/dist/otel.js.map +1 -1
  77. package/dist/pubsub/subscription.d.ts +88 -116
  78. package/dist/pubsub/subscription.d.ts.map +1 -1
  79. package/dist/pubsub/subscription.js +14 -17
  80. package/dist/pubsub/subscription.js.map +1 -1
  81. package/dist/pubsub/topic.d.ts +86 -113
  82. package/dist/pubsub/topic.d.ts.map +1 -1
  83. package/dist/pubsub/topic.js +68 -82
  84. package/dist/pubsub/topic.js.map +1 -1
  85. package/dist/reqctx/mod.d.ts +83 -86
  86. package/dist/reqctx/mod.d.ts.map +1 -1
  87. package/dist/reqctx/mod.js +39 -41
  88. package/dist/reqctx/mod.js.map +1 -1
  89. package/dist/services/index.d.ts +76 -75
  90. package/dist/services/index.d.ts.map +1 -1
  91. package/dist/services/index.js +73 -71
  92. package/dist/services/index.js.map +1 -1
  93. package/dist/shutdown/mod.d.ts +26 -25
  94. package/dist/shutdown/mod.d.ts.map +1 -1
  95. package/dist/shutdown/mod.js +26 -25
  96. package/dist/shutdown/mod.js.map +1 -1
  97. package/dist/storage/clickhouse/database.d.ts +113 -115
  98. package/dist/storage/clickhouse/database.d.ts.map +1 -1
  99. package/dist/storage/clickhouse/database.js +65 -79
  100. package/dist/storage/clickhouse/database.js.map +1 -1
  101. package/dist/storage/clickhouse/errors.d.ts +25 -26
  102. package/dist/storage/clickhouse/errors.d.ts.map +1 -1
  103. package/dist/storage/clickhouse/errors.js +15 -17
  104. package/dist/storage/clickhouse/errors.js.map +1 -1
  105. package/dist/storage/clickhouse/mod.d.ts +10 -10
  106. package/dist/storage/clickhouse/mod.js +10 -10
  107. package/dist/storage/objects/bucket.d.ts +196 -225
  108. package/dist/storage/objects/bucket.d.ts.map +1 -1
  109. package/dist/storage/objects/bucket.js +71 -84
  110. package/dist/storage/objects/bucket.js.map +1 -1
  111. package/dist/storage/objects/error.d.ts +4 -4
  112. package/dist/storage/objects/error.js +4 -4
  113. package/dist/storage/postgres/database.d.ts +124 -149
  114. package/dist/storage/postgres/database.d.ts.map +1 -1
  115. package/dist/storage/postgres/database.js +98 -135
  116. package/dist/storage/postgres/database.js.map +1 -1
  117. package/dist/storage/postgres/errors.d.ts +42 -48
  118. package/dist/storage/postgres/errors.d.ts.map +1 -1
  119. package/dist/storage/postgres/errors.js +44 -51
  120. package/dist/storage/postgres/errors.js.map +1 -1
  121. package/dist/storage/postgres/interval.d.ts +19 -19
  122. package/dist/storage/postgres/interval.d.ts.map +1 -1
  123. package/dist/storage/postgres/interval.js +21 -21
  124. package/dist/storage/postgres/interval.js.map +1 -1
  125. package/dist/storage/redis/bitfield.d.ts +48 -23
  126. package/dist/storage/redis/bitfield.d.ts.map +1 -1
  127. package/dist/storage/redis/bitfield.js +38 -19
  128. package/dist/storage/redis/bitfield.js.map +1 -1
  129. package/dist/storage/redis/command.d.ts +16 -12
  130. package/dist/storage/redis/command.d.ts.map +1 -1
  131. package/dist/storage/redis/command.js +16 -12
  132. package/dist/storage/redis/command.js.map +1 -1
  133. package/dist/storage/redis/commands.d.ts +99 -100
  134. package/dist/storage/redis/commands.d.ts.map +1 -1
  135. package/dist/storage/redis/commands.js +84 -85
  136. package/dist/storage/redis/commands.js.map +1 -1
  137. package/dist/storage/redis/database.d.ts +138 -122
  138. package/dist/storage/redis/database.d.ts.map +1 -1
  139. package/dist/storage/redis/database.js +120 -101
  140. package/dist/storage/redis/database.js.map +1 -1
  141. package/dist/storage/redis/mod.d.ts +52 -48
  142. package/dist/storage/redis/mod.d.ts.map +1 -1
  143. package/dist/storage/redis/mod.js +52 -48
  144. package/dist/storage/redis/mod.js.map +1 -1
  145. package/dist/storage/redis/options.d.ts +26 -24
  146. package/dist/storage/redis/options.d.ts.map +1 -1
  147. package/dist/storage/redis/options.js.map +1 -1
  148. package/dist/storage/redis/pubsub.d.ts +16 -16
  149. package/dist/storage/redis/pubsub.d.ts.map +1 -1
  150. package/dist/storage/redis/pubsub.js +14 -14
  151. package/dist/storage/redis/pubsub.js.map +1 -1
  152. package/dist/storage/redis/reply.d.ts +80 -72
  153. package/dist/storage/redis/reply.d.ts.map +1 -1
  154. package/dist/storage/redis/reply.js +53 -46
  155. package/dist/storage/redis/reply.js.map +1 -1
  156. package/dist/storage/redis/scan.d.ts +4 -4
  157. package/dist/storage/redis/scan.d.ts.map +1 -1
  158. package/dist/storage/redis/scan.js +6 -6
  159. package/dist/storage/redis/scan.js.map +1 -1
  160. package/dist/storage/redis/script.d.ts +28 -21
  161. package/dist/storage/redis/script.d.ts.map +1 -1
  162. package/dist/storage/redis/script.js +29 -22
  163. package/dist/storage/redis/script.js.map +1 -1
  164. package/dist/storage/redis/target.d.ts +17 -1
  165. package/dist/storage/redis/target.d.ts.map +1 -1
  166. package/dist/storage/redis/target.js +30 -1
  167. package/dist/storage/redis/target.js.map +1 -1
  168. package/dist/storage/redis/wire.d.ts +6 -6
  169. package/dist/storage/redis/wire.d.ts.map +1 -1
  170. package/dist/storage/redis/wire.js +6 -6
  171. package/dist/storage/redis/wire.js.map +1 -1
  172. package/dist/testing/mod.d.ts +83 -88
  173. package/dist/testing/mod.d.ts.map +1 -1
  174. package/dist/testing/mod.js +75 -81
  175. package/dist/testing/mod.js.map +1 -1
  176. package/dist/testing/playwright.d.ts +28 -32
  177. package/dist/testing/playwright.d.ts.map +1 -1
  178. package/dist/testing/playwright.js +22 -27
  179. package/dist/testing/playwright.js.map +1 -1
  180. package/dist/testing/puppeteer.d.ts +11 -12
  181. package/dist/testing/puppeteer.d.ts.map +1 -1
  182. package/dist/testing/puppeteer.js +17 -18
  183. package/dist/testing/puppeteer.js.map +1 -1
  184. package/dist/testing/system.d.ts +72 -90
  185. package/dist/testing/system.d.ts.map +1 -1
  186. package/dist/testing/system.js +90 -107
  187. package/dist/testing/system.js.map +1 -1
  188. package/dist/tsconfig.build.tsbuildinfo +1 -1
  189. package/frontends/mod.test.ts +6 -2
  190. package/frontends/mod.ts +20 -19
  191. package/gateway/errors.ts +30 -32
  192. package/gateway/match.ts +61 -57
  193. package/gateway/middleware.ts +62 -64
  194. package/gateway/mod.ts +73 -76
  195. package/gateway/request.ts +143 -140
  196. package/gateway/serve.ts +58 -63
  197. package/gateways/mod.ts +25 -23
  198. package/internal/runtime/napi/napi.cjs +1 -1
  199. package/internal/runtime/napi/napi.d.cts +10 -3
  200. package/internal/runtime/shutdown.ts +113 -101
  201. package/log/logger.test.ts +8 -0
  202. package/log/logger.ts +48 -45
  203. package/metrics/mod.ts +138 -122
  204. package/otel.ts +6 -3
  205. package/package.json +1 -1
  206. package/pubsub/subscription.ts +93 -123
  207. package/pubsub/topic.ts +96 -130
  208. package/reqctx/mod.ts +83 -86
  209. package/services/index.ts +78 -78
  210. package/shutdown/mod.ts +26 -25
  211. package/storage/clickhouse/database.ts +115 -129
  212. package/storage/clickhouse/errors.ts +27 -29
  213. package/storage/clickhouse/mod.ts +10 -10
  214. package/storage/objects/bucket.ts +209 -239
  215. package/storage/objects/error.ts +4 -4
  216. package/storage/postgres/database.ts +131 -164
  217. package/storage/postgres/errors.ts +45 -52
  218. package/storage/postgres/interval.ts +21 -21
  219. package/storage/redis/bitfield.ts +51 -26
  220. package/storage/redis/command.ts +16 -12
  221. package/storage/redis/commands.ts +99 -100
  222. package/storage/redis/database.ts +145 -123
  223. package/storage/redis/mod.ts +52 -48
  224. package/storage/redis/options.ts +26 -24
  225. package/storage/redis/pubsub.ts +14 -14
  226. package/storage/redis/redis.test.ts +17 -2
  227. package/storage/redis/reply.ts +85 -77
  228. package/storage/redis/scan.ts +6 -6
  229. package/storage/redis/script.ts +29 -22
  230. package/storage/redis/target.ts +34 -1
  231. package/storage/redis/wire.ts +8 -8
  232. package/testing/mod.ts +99 -105
  233. package/testing/playwright.ts +32 -37
  234. package/testing/puppeteer.ts +22 -23
  235. package/testing/system.ts +117 -133
@@ -5,143 +5,139 @@ import * as runtime from '../../internal/runtime/mod.js';
5
5
  import { StringLiteral } from '../../internal/utils/constraints.js';
6
6
  import { BucketPerms, Uploader, SignedUploader, Downloader, SignedDownloader, Attrser, Lister, Remover, PublicUrler, AttrsUpdater, IfMatchUploader, IfMatchRemover } from './refs.js';
7
7
  /**
8
- * How often an object is expected to be read, which the cloud provider
9
- * prices its storage by.
8
+ * Storage tier indicating how frequently an object is accessed, used by cloud
9
+ * providers to price storage and retrieval:
10
10
  *
11
- * - `standard`: read often. No minimum storage duration and no retrieval fee.
12
- * - `infrequent`: read about once a month or less (GCS Nearline, S3
13
- * Standard-IA). Billed for at least 30 days, with a fee per read.
14
- * - `cold`: read about once a quarter or less (GCS Coldline, S3 Glacier
15
- * Instant Retrieval; Standard-IA on Cloudflare R2). Billed for at least
16
- * 90 days, with a higher fee per read.
11
+ * - `standard`: frequent access; no minimum storage duration or retrieval fee.
12
+ * - `infrequent`: accessed roughly once a month or less (GCS Nearline, S3
13
+ * Standard-IA); billed for at least 30 days with a per-read retrieval fee.
14
+ * - `cold`: accessed roughly once a quarter or less (GCS Coldline, S3 Glacier
15
+ * Instant Retrieval; Standard-IA on Cloudflare R2); billed for at least 90
16
+ * days with a higher per-read retrieval fee.
17
17
  *
18
- * Every class can be read immediately.
18
+ * Objects in every class remain immediately readable.
19
19
  */
20
20
  export type StorageClass = 'standard' | 'infrequent' | 'cold';
21
21
  /**
22
- * Configuration options for declaring a Bucket.
23
- *
24
- * Encore reads the configuration when it builds the app, so its values must
25
- * be literals.
22
+ * Configuration options for declaring a {@link Bucket}. Values must be
23
+ * literals so Encore can inspect them at build time.
26
24
  */
27
25
  export interface BucketConfig {
28
26
  /**
29
- * Whether the objects in the bucket should be publicly
30
- * accessible, via CDN. Defaults to false if unset.
27
+ * Whether objects in the bucket are publicly accessible via CDN.
28
+ * Defaults to `false`.
31
29
  */
32
30
  public?: boolean;
33
31
  /**
34
- * Whether to enable versioning of the objects in the bucket.
35
- * Defaults to false if unset.
32
+ * Whether object versioning is enabled on the bucket.
33
+ * Defaults to `false`.
36
34
  */
37
35
  versioned?: boolean;
38
36
  /**
39
- * The storage class of an object uploaded without one.
40
- * Defaults to `"standard"`.
37
+ * Default storage class for newly uploaded objects. Defaults to `"standard"`.
41
38
  *
42
- * `"auto"` lets the provider move each object between classes by how
43
- * often it is read (GCS Autoclass, S3 Intelligent-Tiering). It is a
44
- * bucket's class only: objects in such a bucket can't name a class, and
45
- * lifecycle rules can't move them.
39
+ * Setting `"auto"` delegates class transitions to the provider based on
40
+ * access patterns (GCS Autoclass, S3 Intelligent-Tiering). When `"auto"` is
41
+ * set, individual uploads cannot override `storageClass` and lifecycle rules
42
+ * cannot transition storage classes.
46
43
  */
47
44
  storageClass?: StorageClass | 'auto';
48
45
  /**
49
- * Rules that move objects to colder storage classes, or delete them, as
50
- * they age. Providers apply them asynchronously, usually within a day,
51
- * to the objects already in the bucket too.
46
+ * Lifecycle rules that automatically transition objects to colder storage
47
+ * classes or delete them as they age. Providers evaluate rules
48
+ * asynchronously (typically within a day), including for existing objects.
52
49
  */
53
50
  lifecycle?: LifecycleRule[];
54
51
  /**
55
- * Keep every object for at least this long after it was written: it
56
- * can't be deleted or overwritten sooner.
52
+ * Minimum retention period applied to every object in the bucket; objects
53
+ * cannot be deleted or overwritten before this period elapses.
57
54
  */
58
55
  retention?: Retention;
59
56
  /**
60
- * Whether objects can be given their own retain-until time, with the
61
- * `retainUntil` upload option and `extendRetention`.
62
- * Defaults to false if unset.
57
+ * Whether individual objects can specify their own `retainUntil` timestamp
58
+ * via upload options and {@link Bucket.extendRetention}. Defaults to `false`.
63
59
  */
64
60
  objectRetention?: boolean;
65
61
  /**
66
- * Tags that classify the bucket, for policies to read: written out as
67
- * string literals, as in `{data: "pci"}`. Keys and values are lowercase
68
- * letters, digits, `_` and `-`, at most 63 characters; a key starts with a
69
- * letter, and not with `encore`, which is reserved. At most 32 tags.
62
+ * Static string-literal tags that classify the bucket for policy checks
63
+ * (e.g. `{data: "pci"}`). Keys and values may contain lowercase letters,
64
+ * digits, `_`, and `-`, up to 63 characters. Keys must start with a letter
65
+ * and cannot start with the reserved prefix `encore`. At most 32 tags.
70
66
  */
71
67
  tags?: Record<string, string>;
72
68
  }
73
69
  /**
74
- * A lifecycle rule: an optional prefix and at least one action. Days are
75
- * whole numbers from 1 to 36500 and count from when an object was written,
76
- * or for the noncurrent fields, from when it was replaced or removed.
70
+ * A lifecycle rule with an optional key prefix and at least one action. Day
71
+ * counts are whole numbers from 1 to 36500 measured from creation time (or
72
+ * from replacement/deletion time for noncurrent version rules).
77
73
  */
78
74
  export interface LifecycleRule {
79
- /** Only objects whose names start with it. Defaults to every object. */
75
+ /** Restrict the rule to objects whose names start with this prefix. Defaults to all objects. */
80
76
  prefix?: string;
81
77
  /**
82
- * Move an object to `infrequent` this many days after it was written.
83
- * At least 30.
78
+ * Transition objects to `infrequent` storage this many days after creation.
79
+ * Must be at least 30.
84
80
  */
85
81
  moveToInfrequentAfterDays?: number;
86
82
  /**
87
- * Move an object to `cold` this many days after it was written. With
88
- * `moveToInfrequentAfterDays`, at least 30 days after it.
83
+ * Transition objects to `cold` storage this many days after creation. When
84
+ * combined with `moveToInfrequentAfterDays`, must be at least 30 days later.
89
85
  */
90
86
  moveToColdAfterDays?: number;
91
87
  /**
92
- * Delete an object this many days after it was written. In a versioned
93
- * bucket it becomes a noncurrent version, as `remove` does.
88
+ * Delete objects this many days after creation. In versioned buckets, the
89
+ * object becomes a noncurrent version (just like {@link Bucket.remove}).
94
90
  */
95
91
  deleteAfterDays?: number;
96
92
  /**
97
- * Versioned buckets: delete a noncurrent version this many days after it
98
- * was replaced or removed.
93
+ * Versioned buckets only: delete noncurrent versions this many days after
94
+ * they were replaced or removed.
99
95
  */
100
96
  deleteNoncurrentAfterDays?: number;
101
97
  /**
102
- * Versioned buckets: never delete the newest this many noncurrent
103
- * versions. On its own, delete the noncurrent versions beyond them.
98
+ * Versioned buckets only: retain at least this many of the newest noncurrent
99
+ * versions (deleting older noncurrent versions beyond this count when used
100
+ * on its own).
104
101
  */
105
102
  keepNoncurrentVersions?: number;
106
103
  }
107
104
  /**
108
- * A bucket's retention period.
105
+ * Bucket-level retention period.
109
106
  */
110
107
  export interface Retention {
111
- /** The days, from 1 to 36500, an object is kept after it was written. */
108
+ /** Number of days (1 to 36500) to retain each object after creation. */
112
109
  days: number;
113
110
  }
114
111
  /**
115
- * Defines a new Object Storage bucket infrastructure resource.
112
+ * Declares an Object Storage bucket infrastructure resource.
116
113
  */
117
114
  export declare class Bucket extends BucketPerms implements Uploader, SignedUploader, Downloader, SignedDownloader, Attrser, Lister, Remover, PublicUrler, AttrsUpdater, IfMatchUploader, IfMatchRemover {
118
115
  private readonly bucketName;
119
- /** The runtime's bucket: made on first use in test mode. */
116
+ /** Native runtime bucket, initialized lazily in test mode. */
120
117
  private own?;
121
118
  /**
122
- * Creates a new bucket with the given name and configuration
119
+ * Declares a new bucket with the given name and configuration.
123
120
  */
124
121
  constructor(name: string, cfg?: BucketConfig);
125
- /** The native bucket: in a test, the test's instance of it.
126
- * @internal */
122
+ /** Native bucket handle (resolves to the current test's instance in test mode). @internal */
127
123
  get impl(): runtime.Bucket;
128
124
  /**
129
- * Reference an existing bucket by name.
130
- * To create a new storage bucket, use `new StorageBucket(...)` instead.
125
+ * References an existing bucket by name.
126
+ * To declare a new bucket, use `new Bucket(...)` instead.
131
127
  */
132
128
  static named<name extends string>(name: StringLiteral<name>): Bucket;
133
129
  /**
134
- * Lists the objects in the bucket, sorted by name.
130
+ * Lists objects in the bucket in lexicographical order by name.
135
131
  *
136
- * With a `delimiter`, the names that continue past the `prefix` with the
137
- * delimiter are grouped into one entry per common prefix, with
138
- * `isPrefix` set, as a directory listing does.
132
+ * When `delimiter` is set, keys sharing a common prefix past `options.prefix`
133
+ * up to the delimiter are grouped into a single entry with `isPrefix: true`
134
+ * (similar to a directory listing).
139
135
  */
140
136
  list(options?: ListOptions): AsyncGenerator<ListEntry>;
141
137
  /**
142
- * Lists every stored version of the objects in the bucket, sorted by
143
- * name and then newest first. A removed object has no `latest` version.
144
- * An unversioned bucket lists one latest version per object.
138
+ * Lists all stored object versions in the bucket, sorted by name and then
139
+ * newest first. Deleted objects have no `latest` version. In unversioned
140
+ * buckets, yields one `latest` version per object.
145
141
  */
146
142
  listVersions(options?: ListVersionsOptions): AsyncGenerator<ObjectVersion>;
147
143
  /**
@@ -151,7 +147,7 @@ export declare class Bucket extends BucketPerms implements Uploader, SignedUploa
151
147
  exists(name: string, options?: ExistsOptions): Promise<boolean>;
152
148
  /**
153
149
  * Returns the object's attributes.
154
- * Throws an error if the object does not exist.
150
+ * Throws `ObjectNotFound` if the object does not exist.
155
151
  */
156
152
  attrs(name: string, options?: AttrsOptions): Promise<ObjectAttrs>;
157
153
  /**
@@ -159,76 +155,68 @@ export declare class Bucket extends BucketPerms implements Uploader, SignedUploa
159
155
  */
160
156
  upload(name: string, data: Uint8Array, options?: UploadOptions): Promise<ObjectAttrs>;
161
157
  /**
162
- * Uploads an object to the bucket from a stream of bytes: a Web
163
- * `ReadableStream`, a Node.js `Readable`, or any async iterable of
164
- * `Uint8Array` chunks. The stream is read as fast as the upload takes
165
- * its bytes.
158
+ * Uploads an object from a byte stream — a Web `ReadableStream`, Node.js
159
+ * `Readable`, or any async iterable of `Uint8Array` chunks — pulling chunks
160
+ * as the upload consumes them.
166
161
  *
167
162
  * If the stream errors, the upload is aborted and nothing is stored.
168
163
  */
169
164
  uploadStream(name: string, data: AsyncIterable<Uint8Array> | ReadableStream<Uint8Array>, options?: UploadOptions): Promise<ObjectAttrs>;
170
165
  /**
171
- * Uploads an object only if the bucket still holds the given revision of
172
- * it, as a download, `attrs`, `upload`, `updateAttrs` or a listing
173
- * returned it, and throws `PreconditionFailed` otherwise, also if the
174
- * object no longer exists. This makes read-modify-write safe against
175
- * concurrent writers. A missing revision throws `InvalidArgument`.
176
- *
177
- * `data` is bytes or a stream, as `upload` and `uploadStream` take.
166
+ * Conditionally uploads an object only if the bucket still holds `revision`
167
+ * (returned by `download`, `attrs`, `upload`, `updateAttrs`, or `list`),
168
+ * throwing `PreconditionFailed` if the object changed or was deleted. Throws
169
+ * `InvalidArgument` if `revision` is missing.
178
170
  *
179
- * The match compares the object's contents, not its attributes:
180
- * `updateAttrs` doesn't break it. Google Cloud Storage matches the
181
- * revision's `version`, so a revision without one throws
182
- * `InvalidArgument` there; Amazon S3 and Cloudflare R2 match its `etag`.
171
+ * `data` may be a `Uint8Array` or a stream (as in {@link upload} and
172
+ * {@link uploadStream}). Comparisons check object contents rather than
173
+ * metadata, so {@link updateAttrs} does not invalidate a match. GCS matches
174
+ * on `revision.version` (throwing `InvalidArgument` if absent), while S3 and
175
+ * Cloudflare R2 match on `revision.etag`.
183
176
  *
184
- * On Amazon S3 a conditional write also needs read access to the bucket,
185
- * which Encore grants to the services that call this.
177
+ * On AWS S3, conditional writes also require read permission, which Encore
178
+ * grants automatically to calling services.
186
179
  */
187
180
  uploadIfMatch(name: string, data: Uint8Array | AsyncIterable<Uint8Array> | ReadableStream<Uint8Array>, revision: Revision, options?: UploadIfMatchOptions): Promise<ObjectAttrs>;
188
181
  /**
189
- * Replaces the given attributes of an object and leaves the others as
190
- * they are. An empty string clears an attribute (a cleared content type
191
- * is `application/octet-stream`, as S3 keeps no object without one), and
192
- * `metadata` replaces the whole map.
182
+ * Updates the specified attributes of an object while leaving omitted
183
+ * attributes unchanged. Pass an empty string to clear an attribute (clearing
184
+ * `contentType` resets it to `application/octet-stream`), and pass a new
185
+ * `metadata` object to replace the entire metadata map (`{}` clears it).
193
186
  *
194
- * On S3 this rewrites the object, so a versioned bucket gets a new
195
- * version, and the object's age for lifecycle rules starts over.
187
+ * On AWS S3, updating attributes rewrites the object, creating a new version
188
+ * in versioned buckets and resetting the object's lifecycle age.
196
189
  */
197
190
  updateAttrs(name: string, attrs: UpdateAttrs, options?: UpdateAttrsOptions): Promise<ObjectAttrs>;
198
191
  /**
199
- * Keeps the object until `until` at least. Retention can only be
200
- * extended: a time earlier than the object's current one throws
201
- * `InvalidArgument`. The bucket must be declared with `objectRetention`.
192
+ * Extends the object's retention until at least `until`. Retention can only
193
+ * be extended — passing a time earlier than the current retention throws
194
+ * `InvalidArgument`. Requires `objectRetention: true` on the bucket.
202
195
  */
203
196
  extendRetention(name: string, until: Date, options?: ExtendRetentionOptions): Promise<ObjectAttrs>;
204
197
  /**
205
- * Generate an external URL to allow uploading an object to the bucket.
198
+ * Generates a pre-signed URL allowing anyone with the URL to upload to
199
+ * `name` without additional authentication.
206
200
  *
207
- * Anyone with possession of the URL can write to the given object name
208
- * without any additional auth.
209
- *
210
- * The URL doesn't carry the bucket's storage class: an object uploaded
211
- * through it gets the provider's default class for the bucket.
201
+ * Note: Pre-signed upload URLs do not enforce the bucket's configured
202
+ * `storageClass`; uploaded objects receive the provider's default class.
212
203
  */
213
204
  signedUploadUrl(name: string, options?: UploadUrlOptions): Promise<SignedUploadUrl>;
214
205
  /**
215
- * Generate an external URL to allow downloading an object from the bucket.
216
- *
217
- * Anyone with possession of the URL can download the given object without
218
- * any additional auth.
206
+ * Generates a pre-signed URL allowing anyone with the URL to download `name`
207
+ * without additional authentication.
219
208
  */
220
209
  signedDownloadUrl(name: string, options?: DownloadUrlOptions): Promise<SignedDownloadUrl>;
221
210
  /**
222
- * Downloads an object from the bucket. It resolves once the provider has
223
- * answered, before any of the object's bytes: a missing object, or a
224
- * range outside it, throws here. The `Download` says what the provider
225
- * said of the object, and gives its contents whole (`bytes`) or as they
226
- * arrive (`stream`).
211
+ * Starts downloading an object from the bucket. Resolves as soon as the
212
+ * provider responds (throwing immediately if the object is missing or the
213
+ * byte range is invalid), returning a {@link Download} with response
214
+ * metadata and one-shot `bytes()` / `stream()` readers.
227
215
  *
228
216
  * ```ts
229
217
  * const d = await uploads.download("state.json");
230
218
  * const state = JSON.parse((await d.bytes()).toString());
231
- * // Written only if nobody else has since it was read.
219
+ * // Write only if nobody else updated the object since we read it.
232
220
  * await uploads.uploadIfMatch("state.json", next(state), d.revision);
233
221
  * ```
234
222
  */
@@ -239,24 +227,21 @@ export declare class Bucket extends BucketPerms implements Uploader, SignedUploa
239
227
  */
240
228
  remove(name: string, options?: DeleteOptions): Promise<void>;
241
229
  /**
242
- * Removes an object only if the bucket still holds the given revision of
243
- * it, as a download, `attrs`, `upload`, `updateAttrs` or a listing
244
- * returned it, and throws `PreconditionFailed` otherwise, also if the
245
- * object no longer exists. It compares the latest version, so there is no
246
- * `version` to remove. A missing revision throws `InvalidArgument`.
230
+ * Conditionally removes an object only if its latest version still matches
231
+ * `revision` (returned by `download`, `attrs`, `upload`, `updateAttrs`, or
232
+ * `list`), throwing `PreconditionFailed` if it changed or no longer exists.
233
+ * Throws `InvalidArgument` if `revision` is missing.
247
234
  *
248
- * The match compares the object's contents, not its attributes:
249
- * `updateAttrs` doesn't break it.
250
- *
251
- * On Amazon S3 a conditional delete also needs read access to the
252
- * bucket, which Encore grants to the services that call this. Cloudflare
253
- * R2 doesn't support conditional deletes: there it throws
235
+ * Comparisons check object contents rather than metadata, so
236
+ * {@link updateAttrs} does not invalidate a match. On AWS S3, conditional
237
+ * deletes require read permission (granted automatically by Encore).
238
+ * Cloudflare R2 does not support conditional deletes and throws
254
239
  * `InvalidArgument`.
255
240
  */
256
241
  removeIfMatch(name: string, revision: Revision): Promise<void>;
257
242
  /**
258
- * Returns the public URL for accessing the object with the given name.
259
- * Throws an error if the bucket is not public.
243
+ * Returns the public CDN URL for accessing the object.
244
+ * Throws an error if the bucket is not declared with `public: true`.
260
245
  */
261
246
  publicUrl(name: string): string;
262
247
  ref<P extends BucketPerms>(): P;
@@ -266,18 +251,18 @@ export declare class Bucket extends BucketPerms implements Uploader, SignedUploa
266
251
  */
267
252
  export interface ListOptions {
268
253
  /**
269
- * Only include objects with this prefix in the listing.
270
- * If unset, all objects are included.
254
+ * Only include objects whose names start with this prefix.
255
+ * Defaults to all objects.
271
256
  */
272
257
  prefix?: string;
273
258
  /**
274
- * Maximum number of entries to return, common prefixes included.
275
- * Defaults to no limit.
259
+ * Maximum number of entries to return (including common prefixes).
260
+ * Unlimited when unset.
276
261
  */
277
262
  limit?: number;
278
263
  /**
279
- * Group the names that continue past the prefix with this delimiter,
280
- * usually `"/"`, into one entry per common prefix.
264
+ * Delimiter (typically `"/"`) used to group object names past `prefix` into
265
+ * single common-prefix entries.
281
266
  */
282
267
  delimiter?: string;
283
268
  }
@@ -286,34 +271,30 @@ export interface ListOptions {
286
271
  */
287
272
  export interface ListVersionsOptions {
288
273
  /**
289
- * Only include objects with this prefix in the listing.
290
- * If unset, all objects are included.
274
+ * Only include objects whose names start with this prefix.
275
+ * Defaults to all objects.
291
276
  */
292
277
  prefix?: string;
293
- /** Maximum number of versions to return. Defaults to no limit. */
278
+ /** Maximum number of versions to return. Unlimited when unset. */
294
279
  limit?: number;
295
280
  }
296
281
  /**
297
- * Options for retrieving the attributes of an object.
282
+ * Options for retrieving an object's attributes.
298
283
  */
299
284
  export interface AttrsOptions {
300
285
  /**
301
- * The object version to retrieve attributes for.
302
- * Defaults to the lastest version if unset.
303
- *
304
- * If bucket versioning is not enabled, this option is ignored.
286
+ * Object version to inspect. Defaults to the latest version.
287
+ * Ignored if bucket versioning is disabled.
305
288
  */
306
289
  version?: string;
307
290
  }
308
291
  /**
309
- * Options for checking the existence of an object.
292
+ * Options for checking whether an object exists.
310
293
  */
311
294
  export interface ExistsOptions {
312
295
  /**
313
- * The object version to check for existence.
314
- * Defaults to the lastest version if unset.
315
- *
316
- * If bucket versioning is not enabled, this option is ignored.
296
+ * Object version to check. Defaults to the latest version.
297
+ * Ignored if bucket versioning is disabled.
317
298
  */
318
299
  version?: string;
319
300
  }
@@ -322,31 +303,28 @@ export interface ExistsOptions {
322
303
  */
323
304
  export interface DeleteOptions {
324
305
  /**
325
- * The object version to delete.
326
- * Defaults to the lastest version if unset.
327
- *
328
- * If bucket versioning is not enabled, this option is ignored.
306
+ * Object version to delete. Defaults to the latest version.
307
+ * Ignored if bucket versioning is disabled.
329
308
  */
330
309
  version?: string;
331
310
  }
332
311
  /**
333
- * A contiguous byte range within an object: `length` bytes from `offset`,
334
- * or the object's last bytes.
312
+ * A contiguous byte range within an object: either `length` bytes starting at
313
+ * `offset`, or the final `last` bytes of the object.
335
314
  */
336
315
  export type ByteRange = {
337
- /** The zero-based index of the first byte to read. */
316
+ /** Zero-based index of the first byte to read. */
338
317
  offset: number;
339
318
  /**
340
- * The number of bytes to read.
341
- * Defaults to reading to the end of the object if unset.
319
+ * Number of bytes to read. Reads through the end of the object when
320
+ * omitted.
342
321
  */
343
322
  length?: number;
344
323
  last?: never;
345
324
  } | {
346
325
  /**
347
- * Read the object's last `last` bytes, however long it is; all of it,
348
- * if it is shorter. The download's `size` says how long the object
349
- * is, and so where in it the bytes are.
326
+ * Read the final `last` bytes of the object (or the entire object if it
327
+ * is shorter). Check {@link Download.size} for the object's full length.
350
328
  */
351
329
  last: number;
352
330
  offset?: never;
@@ -357,130 +335,122 @@ export type ByteRange = {
357
335
  */
358
336
  export interface DownloadOptions {
359
337
  /**
360
- * The object version to download.
361
- * Defaults to the lastest version if unset.
362
- *
363
- * If bucket versioning is not enabled, this option is ignored.
338
+ * Object version to download. Defaults to the latest version.
339
+ * Ignored if bucket versioning is disabled.
364
340
  */
365
341
  version?: string;
366
342
  /**
367
- * Download only the given byte range of the object, instead of the whole
368
- * object. The download's contents are just the requested bytes; its
369
- * `size` is still the whole object's.
343
+ * Optional byte range to download instead of the full object. The body
344
+ * contains only the requested slice while {@link Download.size} still
345
+ * reports the full object size.
370
346
  *
371
- * Throws InvalidArgument if the range is empty or lies beyond the end
372
- * of the object.
347
+ * Throws `InvalidArgument` if the range is empty or starts past the end of
348
+ * the object.
373
349
  */
374
350
  range?: ByteRange;
375
351
  }
376
352
  /**
377
- * A download under way, as `download` returns it: what the provider said of
378
- * the object when it answered, and the object's contents, which are read
379
- * once, whole or as they arrive.
353
+ * An in-progress download returned by {@link Bucket.download}, exposing basic
354
+ * response metadata and one-shot body readers (`bytes()` or `stream()`).
380
355
  *
381
- * What it says is less than `attrs` does: it is what every provider sends
382
- * with an object's bytes.
383
- *
384
- * A download whose contents are never read keeps its connection open until
385
- * it is garbage collected. To give one up, cancel its stream:
386
- * `await d.stream().cancel()`.
356
+ * Includes only the metadata providers send alongside download responses (use
357
+ * {@link Bucket.attrs} for full metadata). An unread download holds its
358
+ * connection open until garbage collected; call `await d.stream().cancel()` to
359
+ * release it early.
387
360
  */
388
361
  export interface Download {
389
362
  /**
390
- * The revision the contents are of. Pass it to `uploadIfMatch` or
391
- * `removeIfMatch` to write or remove the object only if it is still what
392
- * was read.
363
+ * Revision of the downloaded contents. Pass to {@link Bucket.uploadIfMatch}
364
+ * or {@link Bucket.removeIfMatch} for optimistic concurrency control.
393
365
  */
394
366
  readonly revision: Revision;
395
- /** The size of the whole object in bytes, also when a range is read. */
367
+ /** Full object size in bytes, even when downloading a byte range. */
396
368
  readonly size: number;
397
369
  readonly contentType?: string;
398
- /** When the object last changed, if the provider said. */
370
+ /** Last modification timestamp, if reported by the provider. */
399
371
  readonly lastModified?: Date;
400
372
  /**
401
- * The contents, in one piece. Throws `InvalidArgument` if they were
402
- * already read.
373
+ * Buffers and returns the entire download body. Throws `InvalidArgument` if
374
+ * the body has already been consumed.
403
375
  */
404
376
  bytes(): Promise<Buffer>;
405
377
  /**
406
- * The contents as a Web `ReadableStream`, read from the provider as the
407
- * consumer reads it. Cancelling the stream stops the download. Throws
408
- * `InvalidArgument` if the contents were already read.
378
+ * Streams the download body as a Web `ReadableStream`. Canceling the stream
379
+ * aborts the download. Throws `InvalidArgument` if the body has already been
380
+ * consumed.
409
381
  *
410
- * In Node.js, `Readable.fromWeb` converts it to a Node.js stream.
382
+ * In Node.js, use `Readable.fromWeb` to convert this into a Node stream.
411
383
  */
412
384
  stream(): ReadableStream<Uint8Array>;
413
385
  }
414
386
  /**
415
- * One revision of an object: what `uploadIfMatch`, `removeIfMatch` and the
416
- * `ifMatch` precondition of `updateAttrs` compare. `ObjectAttrs` is one, so
417
- * the attributes an operation returned can be passed as they are, and a
418
- * download's `revision` is one, of the contents it reads.
387
+ * Identifies a specific content revision of an object for conditional
388
+ * operations (`uploadIfMatch`, `removeIfMatch`, and `updateAttrs` `ifMatch`).
389
+ * Both {@link ObjectAttrs} and {@link Download.revision} satisfy `Revision`.
419
390
  */
420
391
  export interface Revision {
421
392
  etag: string;
422
393
  version?: string;
423
394
  }
424
395
  /**
425
- * Conditions on the object an upload writes.
396
+ * Preconditions for an upload.
426
397
  */
427
398
  export interface Preconditions {
428
399
  /**
429
- * Only write the object if it does not exist yet.
430
- * Throws `PreconditionFailed` otherwise.
400
+ * Only write the object if it does not already exist; throws
401
+ * `PreconditionFailed` otherwise.
431
402
  */
432
403
  notExists?: boolean;
433
404
  }
434
405
  /**
435
- * Describes the attributes of an object stored in a bucket.
406
+ * Attributes of an object stored in a bucket.
436
407
  */
437
408
  export interface ObjectAttrs {
438
409
  name: string;
439
410
  size: number;
440
- /** The version of the object, if bucket versioning is enabled. */
411
+ /** Object version identifier, if bucket versioning is enabled. */
441
412
  version?: string;
442
413
  etag: string;
443
414
  contentType?: string;
444
415
  cacheControl?: string;
445
416
  contentDisposition?: string;
446
- /** Custom metadata; empty if the object has none. */
417
+ /** Custom metadata map (empty object if none). */
447
418
  metadata: Record<string, string>;
448
- /** When this version of the object was written. */
419
+ /** Timestamp when this object version was written. */
449
420
  lastModified?: Date;
450
421
  /**
451
- * The object's storage class. Every object in a bucket whose class is
452
- * `"auto"` reads `"auto"`. Undefined for a class Encore doesn't model,
453
- * set outside Encore.
422
+ * Object storage class (`"auto"` for buckets with `storageClass: "auto"`,
423
+ * or `undefined` if a provider-specific class was set outside Encore).
454
424
  */
455
425
  storageClass?: StorageClass | 'auto';
456
- /** The object's own retain-until time, if it has one. */
426
+ /** Per-object retain-until timestamp, if set. */
457
427
  retainUntil?: Date;
458
428
  }
459
429
  /**
460
- * A single entry returned when listing objects in a bucket.
430
+ * A single entry yielded by {@link Bucket.list}.
461
431
  */
462
432
  export interface ListEntry {
463
- /** The object's name, or a common prefix, ending in the delimiter. */
433
+ /** Object key, or common prefix ending with the delimiter. */
464
434
  name: string;
465
435
  size: number;
466
436
  etag: string;
467
- /** When the object was written. Unset for a common prefix. */
437
+ /** Timestamp when the object was written (unset for common prefixes). */
468
438
  lastModified?: Date;
469
439
  /**
470
- * Whether the entry is a common prefix of a listing with a delimiter,
471
- * rather than an object. A prefix has size 0 and an empty etag.
440
+ * `true` when this entry represents a common prefix grouped by a delimiter
441
+ * (with `size: 0` and empty `etag`), rather than an object.
472
442
  */
473
443
  isPrefix: boolean;
474
444
  }
475
445
  /**
476
- * One stored version of an object, as `listVersions` lists it.
446
+ * A single stored object version yielded by {@link Bucket.listVersions}.
477
447
  */
478
448
  export interface ObjectVersion {
479
449
  name: string;
480
450
  version?: string;
481
451
  size: number;
482
452
  etag: string;
483
- /** Whether this is the object's current version. */
453
+ /** Whether this is the object's current (latest) version. */
484
454
  latest: boolean;
485
455
  lastModified?: Date;
486
456
  }
@@ -489,34 +459,35 @@ export interface ObjectVersion {
489
459
  */
490
460
  export interface UploadOptions {
491
461
  contentType?: string;
492
- /** The `Cache-Control` header that downloads of the object get. */
462
+ /** `Cache-Control` header returned when downloading the object. */
493
463
  cacheControl?: string;
494
- /** The `Content-Disposition` header that downloads of the object get. */
464
+ /** `Content-Disposition` header returned when downloading the object. */
495
465
  contentDisposition?: string;
496
466
  /**
497
- * Custom metadata. Keys match `[a-z0-9][a-z0-9_-]*` and values are
498
- * printable ASCII. Keys and values together may take 8 KiB on GCS and
467
+ * Custom key-value metadata. Keys must match `[a-z0-9][a-z0-9_-]*` and
468
+ * values must be printable ASCII. Total size is limited to 8 KiB on GCS and
499
469
  * 2 KiB on S3.
500
470
  */
501
471
  metadata?: Record<string, string>;
502
- /** The object's storage class. Defaults to the bucket's. */
472
+ /** Object storage class. Defaults to the bucket's configured storage class. */
503
473
  storageClass?: StorageClass;
504
474
  /**
505
- * Keep the object until then: it can't be deleted or overwritten
506
- * sooner. The bucket must be declared with `objectRetention`.
475
+ * Prevents the object from being deleted or overwritten until this time.
476
+ * Requires `objectRetention: true` on the bucket.
507
477
  */
508
478
  retainUntil?: Date;
509
479
  preconditions?: Preconditions;
510
480
  }
511
481
  /**
512
- * Options for `uploadIfMatch`: those of `upload`, without preconditions.
482
+ * Options for {@link Bucket.uploadIfMatch} (all {@link UploadOptions} except
483
+ * `preconditions`).
513
484
  */
514
485
  export type UploadIfMatchOptions = Omit<UploadOptions, 'preconditions'>;
515
486
  /**
516
- * The attributes `updateAttrs` replaces. An attribute left out stays as it
517
- * is, and an empty string clears it; a cleared `contentType` is
518
- * `application/octet-stream`. `metadata` replaces the whole map, so `{}`
519
- * clears it.
487
+ * Attributes to update via {@link Bucket.updateAttrs}. Omitted fields remain
488
+ * unchanged; an empty string clears a field (clearing `contentType` resets it
489
+ * to `application/octet-stream`). `metadata` replaces the entire map (`{}`
490
+ * clears it).
520
491
  */
521
492
  export interface UpdateAttrs {
522
493
  contentType?: string;
@@ -528,12 +499,12 @@ export interface UpdateAttrs {
528
499
  * Options for updating an object's attributes.
529
500
  */
530
501
  export interface UpdateAttrsOptions {
531
- /** The object version to update. Defaults to the latest. */
502
+ /** Object version to update. Defaults to the latest version. */
532
503
  version?: string;
533
504
  preconditions?: {
534
505
  /**
535
- * Only update the object if it is still this revision.
536
- * Throws `PreconditionFailed` otherwise.
506
+ * Only update the object if it still matches this revision; throws
507
+ * `PreconditionFailed` otherwise.
537
508
  */
538
509
  ifMatch?: Revision;
539
510
  };
@@ -542,16 +513,16 @@ export interface UpdateAttrsOptions {
542
513
  * Options for extending an object's retention.
543
514
  */
544
515
  export interface ExtendRetentionOptions {
545
- /** The object version to retain. Defaults to the latest. */
516
+ /** Object version to retain. Defaults to the latest version. */
546
517
  version?: string;
547
518
  }
548
519
  /**
549
520
  * Options for generating a signed upload URL.
550
521
  */
551
522
  export interface UploadUrlOptions {
552
- /** The expiration time of the url, in seconds from signing. The maximum
553
- * value is seven days. If no value is given, a default of one hour is
554
- * used. */
523
+ /**
524
+ * URL lifetime in seconds from creation (maximum 7 days; defaults to 1 hour).
525
+ */
555
526
  ttl?: number;
556
527
  }
557
528
  /**
@@ -564,9 +535,9 @@ export interface SignedUploadUrl {
564
535
  * Options for generating a signed download URL.
565
536
  */
566
537
  export interface DownloadUrlOptions {
567
- /** The expiration time of the url, in seconds from signing. The maximum
568
- * value is seven days. If no value is given, a default of one hour is
569
- * used. */
538
+ /**
539
+ * URL lifetime in seconds from creation (maximum 7 days; defaults to 1 hour).
540
+ */
570
541
  ttl?: number;
571
542
  }
572
543
  /**