diff --git a/__tests__/test-utils/gas-stubs.ts b/__tests__/test-utils/gas-stubs.ts index c8ee51d5..391e49a2 100644 --- a/__tests__/test-utils/gas-stubs.ts +++ b/__tests__/test-utils/gas-stubs.ts @@ -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: diff --git a/backend.tsconfig.json b/backend.tsconfig.json index 8ef0f23c..d6ea6779 100644 --- a/backend.tsconfig.json +++ b/backend.tsconfig.json @@ -5,5 +5,8 @@ "lib": ["es6"], "types": ["google-apps-script"], "verbatimModuleSyntax": false - } + }, + "include": [ + "src/backend/Drive-shim.d.ts" + ] } diff --git a/src/backend/Drive-shim.d.ts b/src/backend/Drive-shim.d.ts new file mode 100644 index 00000000..ce82bbb9 --- /dev/null +++ b/src/backend/Drive-shim.d.ts @@ -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; +}