Package Exports
- @ciderjs/gasnuki
- @ciderjs/gasnuki/promise
Readme
gasnuki
Type definitions and utilities for Google Apps Script client-side API
Overview
gasnuki provides TypeScript type definitions and utilities for safely using the Google Apps Script client-side API. It helps ensure type-safe communication between Apps Script and your frontend.
Installation
npm install @ciderjs/gasnukior
pnpm add @ciderjs/gasnukiUsage
- Generate type definitions by running:
npx @ciderjs/gasnukiThis will generate type definition files in the types directory by default.
- Make sure the generated directory (default:
types) is included in yourtsconfig.json:
{
"compilerOptions": {
// ... your options ...
},
"include": [
"src",
"types" // Add this line if your type definitions are in the 'types' directory
]
}- Then, you can use
googlewith Type Definitions.
// Type-safe access to google.script.run
// Example: Call the server-side function getContent
google.script.run
.withSuccessHandler((result) => {
console.log(result);
})
.getContent('Sheet1');Features
- Type definitions for Google Apps Script client-side API
- Utility type to convert server-side function return types to void
Contributing
Bug reports and pull requests are welcome. Please use the issues or pull requests section.
License
MIT