Skip to content

Commit

Permalink
Fixed typings for Drive v2
Browse files Browse the repository at this point in the history
  • Loading branch information
marekdedic committed Dec 18, 2024
1 parent ca068cf commit a5d0fd4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion __tests__/test-utils/gas-stubs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function mockedCommentsCollection(): GoogleAppsScript.Drive.Collection.Co
};
}

export function mockedDrive(): GoogleAppsScript.Drive {
export function mockedDrive(): GoogleAppsScript.Drive_v2 {
return {
newChannel: jest.fn<() => GoogleAppsScript.Drive.Schema.Channel>(),
newChildReference:
Expand Down
7 changes: 5 additions & 2 deletions backend.tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"compilerOptions": {
"target": "es6",
"lib": ["es6"],
"types": ["google-apps-script"],
"types": ["google-apps-script", "google.script.client-side"],
"verbatimModuleSyntax": false
}
},
"include": [
"src/backend/Drive-shim.d.ts"
]
}
7 changes: 7 additions & 0 deletions src/backend/Drive-shim.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// eslint-disable-next-line @typescript-eslint/naming-convention -- GAS global
declare var Drive: GoogleAppsScript.Drive_v2;

declare global {
// eslint-disable-next-line @typescript-eslint/naming-convention -- GAS global
var Drive: GoogleAppsScript.Drive_v2;
}

0 comments on commit a5d0fd4

Please sign in to comment.