diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..4766d36 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,31 @@ +declare module "octokit-commit-multiple-files" { + import { Octokit } from "@octokit/rest"; + + declare function plugin(octokit: Octokit); +} + +declare module "octokit-commit-multiple-files/create-or-update-files" { + import { Octokit } from "@octokit/rest"; + + type BufferFromSource = + | arrayBuffer + | Uint8Array + | ReadonlyArray + | WithImplicitCoercion | string> + | WithImplicitCoercion + | { [Symbol.toPrimitive](hint: "string"): string }; + + interface CreateOrUpdateFilesOptions { + owner: string; + repo: string; + branch: string; + changes: Array<{ + message: string; + files: { + [path: string]: string | BufferFromSource | { contents: string | BufferFromSource }; + }; + }>; + } + + export default function createOrUpdateFiles(octokit: Octokit, opts: CreateOrUpdateFilesOptions); +}