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

@inkdropapp/types

v0.0.3

Published

Some helper methods needed to simplify the development of plugins and themes

Readme

@inkdropapp/types

TypeScript type definitions for Inkdrop plugin development.

This package provides ambient type declarations for the inkdrop global object (the Environment class) and the 'inkdrop' module, giving plugin authors full IntelliSense and type-checking support.

Installation

npm install --save-dev @inkdropapp/types

Setup

Add @inkdropapp/types to your tsconfig.json:

{
  "compilerOptions": {
    "types": ["@inkdropapp/types"]
  }
}

This enables two things:

  1. The inkdrop global -- typed as the Environment class, available in any file without importing
  2. The 'inkdrop' module -- typed ambient module for import { ... } from 'inkdrop'

Usage

The inkdrop global

The inkdrop global provides access to the application environment -- managers for commands, keymaps, packages, notifications, the local database, and more.

// Access the config
const fontSize = inkdrop.config.get('editor.fontSize')

// Register a command
inkdrop.commands.add(document.body, {
  'my-plugin:do-something': () => {
    // ...
  }
})

// Query the local database
const note = await inkdrop.localDB.notes.get('note:abc123')

// Listen for editor load
inkdrop.onEditorLoad((editor) => {
  console.log('Editor loaded:', editor)
})

The 'inkdrop' module

Plugins can import utilities and models from the 'inkdrop' module. These are provided by Inkdrop at runtime and should not be bundled into your plugin.

import { models, logger, useModal, createLogger } from 'inkdrop'

// ORM models
const note = await models.Note.loadWithId('note:abc123')
note.title = 'Updated Title'
await note.save()

// Logging
logger.debug('Processing:', data)

const myLogger = createLogger('my-plugin')
myLogger.info('Plugin initialized')

// React hook for modals
function MyDialog() {
  const modal = useModal()
  return (
    <>
      <button onClick={modal.show}>Open</button>
      {modal.state.visible && <Dialog onClose={modal.close} />}
    </>
  )
}

Other exports from the 'inkdrop' module include:

  • actions -- Redux action creators (typed as any)
  • AssistiveError -- Error class with detail and debugInfo properties
  • html2markdown -- Convert HTML strings to Markdown
  • markdownRenderer -- The application's Markdown renderer
  • exportUtils -- Export notes as HTML or Markdown
  • importUtils -- Import Markdown or HTML files as notes

Command types

The package provides typed command maps for every scope in the application. Use these to get type-safe command dispatching:

import type {
  EnvironmentCommands,
  EditorCommands,
  MDELocalCommands
} from '@inkdropapp/types'

Each command map is a record of command names to their parameter types. Commands that take no parameters use undefined:

// EnvironmentCommands
'core:new-note': undefined
'core:open-note': { noteId: string; revision?: string; viewMode?: EditorViewMode }

// EditorCommands
'core:save-note': undefined
'editor:insert-text': { text: string; selection?: { anchor: number; head?: number } }

Available command scopes: EnvironmentCommands, WindowCommands, ApplicationCommands, EditorCommands, MDECommands, MDELocalCommands, MDEPreviewCommands, MDEPreviewLocalCommands, FindInNoteGlobalCommands, FindInNoteOnEditorLocalCommands, FindInNoteOnPreviewLocalCommands, NoteListBarLayoutCommands, NoteListBarCommands, NoteListSearchBarCommands, SidebarNavigationCommands, SidebarMenuCommands, SidebarMenuLocalCommands, SideBarMenuItemCommands, SidebarWorkspaceMenuCommands, SidebarWorkspaceMenuLocalCommands, EditorDrawerCommands, MainLayoutCommands, MDESearchBarLocalCommands, PreviewFindBarLocalCommands.

Importing individual types

All type definitions are also importable from @inkdropapp/types directly:

import type {
  Environment,
  Config,
  CommandRegistry,
  NotificationManager,
  IPCLocalDatabase,
  KeymapManager,
  PackageManager,
  MarkdownRenderer,
  ModelNote,
  ModelBook,
  Logger,
  EnvironmentCommands,
  EditorCommands
} from '@inkdropapp/types'

What's included

Environment & managers

| Type | Description | |------|-------------| | Environment | The main application environment (inkdrop global) | | Config | Application configuration with schema enforcement | | CommandRegistry | Register and dispatch commands | | KeymapManager | Keybinding management | | NotificationManager | User notifications | | PackageManager | Plugin lifecycle management | | ThemeManager | Theme management | | ComponentManager | Custom React component registry | | LayoutManager | UI layout management | | StyleManager | Stylesheet management | | MenuManager | Application menu management | | ContextMenuManager | Context menu management | | TelescopeManager | Telescope (command palette) sources | | MarkdownRenderer | Markdown-to-React rendering pipeline | | ApplicationDelegate | Platform-specific application delegate |

Commands

| Type | Description | |------|-------------| | EnvironmentCommands | Commands on the global scope (core:new-note, core:open-note, etc.) | | WindowCommands | Window management commands (window:reload, window:close, etc.) | | ApplicationCommands | Application-level commands (application:quit, application:open-preferences, etc.) | | EditorCommands | Editor component commands (core:save-note, editor:insert-images, etc.) | | MDECommands | Markdown editor global commands (editor:focus-mde, editor:add-extension, etc.) | | MDELocalCommands | Markdown editor local commands (cursor movement, text formatting, etc.) | | MDEPreviewCommands | Preview pane commands | | FindInNoteGlobalCommands | Find/replace commands (global) | | NoteListBarLayoutCommands | Note list navigation commands | | SidebarMenuCommands | Sidebar commands | | MainLayoutCommands | Layout toggle commands | | EditorViewMode | Editor view mode union type ('preview' \| 'sideBySide' \| 'edit') |

IPC (Inter-Process Communication)

| Type | Description | |------|-------------| | IPCLocalDatabase | Local PouchDB database access (notes, books, tags, files) | | IPCWindow | Window management | | IPCDialog | Native dialog access | | IPCClipboard | Clipboard access |

'inkdrop' module types

| Type | Description | |------|-------------| | ModelNote, ModelBook, ModelTag, ModelFile | ORM model classes | | Logger | Logger interface | | NoteExportHelper, NoteExporter | Note export utilities | | NoteImportHelper, NoteImporter | Note import utilities | | UseModalResult, ModalState | Modal hook types |

Dependencies

This package depends on the following for their type definitions. Inkdrop provides these at runtime -- plugins should externalize them in their bundler config:

  • @codemirror/commands, @codemirror/language, @codemirror/search, @codemirror/state, @codemirror/view
  • inkdrop-model
  • redux
  • glob

Links