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 646f665
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 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
5 changes: 4 additions & 1 deletion backend.tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
"lib": ["es6"],
"types": ["google-apps-script"],
"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 646f665

Please sign in to comment.