npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@haerphi/vscode-git-api-types

v1.0.2

Published

TypeScript type definitions for the VS Code built-in Git extension API

Readme

@haerphi/vscode-git-api-types

TypeScript type definitions for the VS Code built-in Git extension API.

Installation

npm install @haerphi/vscode-git-api-types
# or
pnpm add @haerphi/vscode-git-api-types

Usage

import type { GitExtension, API, Repository } from '@haerphi/vscode-git-api-types';

const gitExtension = vscode.extensions.getExtension<GitExtension>('vscode.git')!.exports;
const git: API = gitExtension.getAPI(1);

Available types

Main entry points

| Type | Description | |------|-------------| | GitExtension | Root of the API, retrieved via vscode.extensions.getExtension('vscode.git') | | API | Main API object returned by GitExtension.getAPI(1) | | Repository | Represents a Git repository |

Interfaces

| Interface | Description | |-----------|-------------| | Git | Exposes the path to the git executable | | InputBox | The commit message input box | | Ref | A Git reference (branch, tag, etc.) | | Branch | A Git branch, extends Ref | | UpstreamRef | The upstream reference of a branch | | Commit | A Git commit | | CommitShortStat | File/insertion/deletion stats for a commit | | Remote | A Git remote | | Submodule | A Git submodule | | Worktree | A Git worktree | | Change | A file change (staged, unstaged, merge conflict…) | | DiffChange | A Change with insertion/deletion counts | | RepositoryState | Full state of a repository (HEAD, refs, remotes, changes…) | | RepositoryUIState | UI state of a repository (selected in the SCM panel) | | RepositoryAccessDetails | Root URI and last access time of a repository | | LogOptions | Options for Repository.log() | | CommitOptions | Options for Repository.commit() | | FetchOptions | Options for Repository.fetch() | | InitOptions | Options for API.init() | | CloneOptions | Options for API.clone() | | RefQuery | Query parameters for Repository.getRefs() | | BranchQuery | Query parameters for Repository.getBranches(), extends RefQuery | | RemoteSource | A remote source (name, URL) | | RemoteSourceProvider | Provider for listing remote sources | | RemoteSourcePublisher | Provider for publishing a repository to a remote | | Credentials | Username/password credentials | | CredentialsProvider | Provider for Git credentials | | PostCommitCommandsProvider | Provider for commands to run after a commit | | PushErrorHandler | Handler for push errors | | BranchProtection | Branch protection rules for a remote | | BranchProtectionRule | Include/exclude patterns for branch protection | | BranchProtectionProvider | Provider for branch protection rules | | AvatarQuery | Query for contributor avatars | | AvatarQueryCommit | Commit info used in an avatar query | | SourceControlHistoryItemDetailsProvider | Provider for SCM history item details (avatars, hover commands, message links) | | PublishEvent | Event fired when a repository is published |

Enums

| Enum | Values | |------|--------| | RefType | Head, RemoteHead, Tag | | Status | INDEX_MODIFIED, INDEX_ADDED, INDEX_DELETED, INDEX_RENAMED, INDEX_COPIED, MODIFIED, DELETED, UNTRACKED, IGNORED, INTENT_TO_ADD, INTENT_TO_RENAME, TYPE_CHANGED, ADDED_BY_US, ADDED_BY_THEM, DELETED_BY_US, DELETED_BY_THEM, BOTH_ADDED, BOTH_DELETED, BOTH_MODIFIED | | ForcePushMode | Force, ForceWithLease, ForceWithLeaseIfIncludes | | GitErrorCodes | BadConfigFile, BadRevision, AuthenticationFailed, NotAGitRepository, PushRejected, DirtyWorkTree, BranchAlreadyExists, NoStashFound, … (full list in index.d.ts) |

Type aliases

| Alias | Values | |-------|--------| | APIState | 'uninitialized' | 'initialized' | | RepositoryKind | 'repository' | 'submodule' | 'worktree' |

Keeping types up to date

The types are sourced directly from the VS Code repository. To update index.d.ts to the latest version:

npm run update
# optionally, with a GitHub token to avoid rate limiting (60 req/h without token):
GITHUB_TOKEN=ghp_xxx npm run update

Then bump the package version and republish:

npm version patch
npm publish --access public

License

MIT