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

@sinc-gmbh/textcontrol-promises

v34.1.3

Published

Wraps TXTextControl Callback API to work with Objects and Promises.

Readme

textcontrol-promises

@sinc-gmbh/textcontrol-promises wraps the TX TextControl callback-based JavaScript API into a modern Promise + async-iterator API with full TypeScript type definitions.

Architecture

┌─────────────────────────────────────────────────────┐
│  Consumer App                                        │
│  import { TextControlContext } from                  │
│    "@sinc-gmbh/textcontrol-promises"                 │
└────────────────────┬────────────────────────────────┘
                     │  async/await, typed
┌────────────────────▼────────────────────────────────┐
│  lib/  (@sinc-gmbh/textcontrol-promises)             │
│  TextControlContext → generated base + hand-written  │
│  Collection (async-iterable)                         │
│  lib/types/  (TypeScript declarations)               │
└────────────────────┬────────────────────────────────┘
                     │  callbacks
┌────────────────────▼────────────────────────────────┐
│  TX TextControl SDK                                  │
│  Loaded at runtime via WebSocket                     │
│  window.TXTextControl (vendor, untyped)              │
└─────────────────────────────────────────────────────┘

Installation

yarn add @sinc-gmbh/textcontrol-promises
# or
npm install @sinc-gmbh/textcontrol-promises

TypeScript — global type setup

Create types/global.d.ts in your project:

import { TXTextControlTypeDefinition } from "@sinc-gmbh/textcontrol-promises";
declare global {
    var TXTextControl: typeof TXTextControlTypeDefinition;
}

JSDoc — type import in plain JS

/** @import {TXTextControlTypeDefinition as TXTextControl} from "@sinc-gmbh/textcontrol-promises" */

Code examples

Initialize the editor

import { TextControlContext } from "@sinc-gmbh/textcontrol-promises";

const txContext = new TextControlContext();

await txContext.initialize(
    {
        containerID: "editor",
        webSocketURL: websocketUrl,
        editorSettings: { culture: "de-DE", uiCulture: "de-DE" },
        replaceContainer: true,
    },
    resourceUrl  // points to /GetResource?name=tx-document-editor.min.js
);

await txContext.untilTextControlLoaded();  // resolves when TextControlLoaded fires

Async iterator over a collection

for await (const field of txContext.editableRegions) {
    const user = await field.userName;   // cached getter — one API call max
    console.log(user);
}

Property caching — read and write

Hand-written wrapper classes expose JS getter properties so you can await obj.name instead of await obj.getName(). The value is fetched lazily and cached for the lifetime of the object.

const field = /* a TextField instance */;

// First access calls the TX API; subsequent reads return the cached Promise.
const name = await field.name;

// Setter updates the TX API and pre-populates the cache optimistically.
await field.setName('NewFieldName');
const updated = await field.name;  // returns 'NewFieldName' without a second API call

The underlying getName() / setName() methods from the generated base remain available if you prefer explicit calls.

Wrap a native TX object

import { Table } from "@sinc-gmbh/textcontrol-promises";

const table = new Table(txNativeTableObject);
const rows = await table.rows.count();

Repository structure

textcontrol-promises/
├── lib/
│   ├── src/
│   │   ├── TextControlContext.js       hand-written public class
│   │   ├── generated/                  auto-generated Promise-wrapping base classes
│   │   ├── Collection.js               async-iterable base for TX collections
│   │   ├── ApplicationField.js         hand-written wrapper classes (one per TX obj)
│   │   └── helper/                     RequestHelper, waitUntil, CallbackType, …
│   ├── types/
│   │   ├── TXTextControlTypeDefinition.d.ts   main barrel export
│   │   ├── objects/                    one .d.ts per TX API class
│   │   ├── args/                       EventArgs shapes
│   │   ├── enums/                      TX enum constants
│   │   ├── callbacks/                  callback signature types
│   │   └── helper/                     EventMap, TabNameType
│   ├── index.js
│   └── index.d.ts
├── tools/
│   ├── scraper/                        Playwright BFS crawler + d.ts differ/patcher
│   └── generator/                      ts-morph Promise-wrapper code generator
├── tests/
│   ├── AGENT_PROFILE.md
│   ├── testsets/
│   └── testcases/
└── demo/                               local integration test app

Development tooling

| Tool | Purpose | Docs | |---|---|---| | tools/scraper | Scrape TX docs, diff against d.ts, patch stubs | Scraper wiki | | tools/generator | Generate Promise-wrapper base classes from d.ts | Generator wiki |

See also:

Generated API docs

https://sinc-gmbh.github.io/textcontrol-promises

License

Copyright (c) 2023 SINC GmbH. All rights reserved. Licensed under the MIT license.