Skip to content

Commit 2c8c97d

Browse files
committed
Refactor function type.
1 parent c56a22c commit 2c8c97d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/runtime/manifest.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,14 @@ const RESETTABLE_OPTIONS: ResettableKeys<ManifestEndpoint> = {
148148
serviceAccountEmail: null,
149149
};
150150

151+
interface ManifestOptions {
152+
preserveExternalChanges?: boolean;
153+
}
154+
151155
/**
152156
* @internal
153157
*/
154-
export function initEndpoint(...opts: { preserveExternalChanges?: boolean }[]): ManifestEndpoint {
158+
export function initEndpoint(...opts: ManifestOptions[]): ManifestEndpoint {
155159
const endpoint: ManifestEndpoint = {};
156160
if (opts.every((opt) => !opt?.preserveExternalChanges)) {
157161
for (const key of Object.keys(RESETTABLE_OPTIONS)) {
@@ -187,7 +191,7 @@ const RESETTABLE_RATE_LIMITS_OPTIONS: ResettableKeys<
187191
* @internal
188192
*/
189193
export function initTaskQueueTrigger(
190-
...opts: { preserveExternalChanges?: boolean }[]
194+
...opts: ManifestOptions[]
191195
): ManifestEndpoint["taskQueueTrigger"] {
192196
let taskQueueTrigger = {};
193197
if (opts.every((opt) => !opt?.preserveExternalChanges)) {
@@ -229,7 +233,7 @@ const RESETTABLE_V2_SCHEDULE_OPTIONS: Omit<
229233
function initScheduleTrigger(
230234
resetOptions: Record<string, unknown>,
231235
schedule: string | Expression<string>,
232-
...opts: { preserveExternalChanges?: boolean }[]
236+
...opts: ManifestOptions[]
233237
): ManifestEndpoint["scheduleTrigger"] {
234238
let scheduleTrigger: ManifestEndpoint["scheduleTrigger"] = { schedule };
235239
if (opts.every((opt) => !opt?.preserveExternalChanges)) {
@@ -247,7 +251,7 @@ function initScheduleTrigger(
247251
*/
248252
export function initV1ScheduleTrigger(
249253
schedule: string | Expression<string>,
250-
...opts: { preserveExternalChanges?: boolean }[]
254+
...opts: ManifestOptions[]
251255
): ManifestEndpoint["scheduleTrigger"] {
252256
return initScheduleTrigger(RESETTABLE_V1_SCHEDULE_OPTIONS, schedule, ...opts);
253257
}
@@ -257,7 +261,7 @@ export function initV1ScheduleTrigger(
257261
*/
258262
export function initV2ScheduleTrigger(
259263
schedule: string | Expression<string>,
260-
...opts: { preserveExternalChanges?: boolean }[]
264+
...opts: ManifestOptions[]
261265
): ManifestEndpoint["scheduleTrigger"] {
262266
return initScheduleTrigger(RESETTABLE_V2_SCHEDULE_OPTIONS, schedule, ...opts);
263267
}

0 commit comments

Comments
 (0)