Skip to content

Commit b17e0b7

Browse files
authored
Fix copilot_driver JSDoc callback typing to unblock JS CI typecheck (#26786)
1 parent ae832fb commit b17e0b7

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

actions/setup/js/copilot_driver.cjs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,18 @@ const MODEL_NOT_SUPPORTED_PATTERN = /The requested model is not supported/;
6161
// because the missing token will still be absent on every subsequent attempt.
6262
const NO_AUTH_INFO_PATTERN = /No authentication information found/;
6363

64+
/**
65+
* @typedef {(path: import("node:fs").PathOrFileDescriptor, data: string | Uint8Array, options?: import("node:fs").WriteFileOptions) => void} NodeAppendFileSync
66+
*/
67+
68+
/**
69+
* @typedef {(path: string, data: string, encoding: string) => void} StringAppendLineWriter
70+
*/
71+
72+
/**
73+
* @typedef {NodeAppendFileSync | StringAppendLineWriter} AppendFileSyncLike
74+
*/
75+
6476
/**
6577
* Emit a timestamped diagnostic log line to stderr.
6678
* All driver messages are prefixed with "[copilot-driver]" so they are easy to
@@ -137,7 +149,7 @@ function buildInfrastructureIncompletePayload(details) {
137149

138150
/**
139151
* Append one safe-output entry line.
140-
* @param {(path: string, data: string, encoding: string) => void} appendFileSync
152+
* @param {AppendFileSyncLike} appendFileSync
141153
* @param {string} safeOutputsPath
142154
* @param {string} payload
143155
*/
@@ -151,7 +163,7 @@ function appendSafeOutputLine(appendFileSync, safeOutputsPath, payload) {
151163
* @param {string} details
152164
* @param {{
153165
* safeOutputsPath?: string,
154-
* appendFileSync?: (path: string, data: string, encoding: string) => void,
166+
* appendFileSync?: AppendFileSyncLike,
155167
* logger?: (message: string) => void
156168
* }=} options
157169
*/

0 commit comments

Comments
 (0)