DefinitelyTyped
Repos
22

Events

[ltijs] Also export other types in `Provider.ts`

@adam-nielsen: Everything looks good here. I am ready to merge this PR (at 1c2ec97) on your behalf whenever you think it's ready.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! :heart:

(@paulschwoerer: you can do this too.)

Created at 1 hour ago

🤖 Merge PR #64172 Allow spritesmith types import by @Zenoo

  • fix: Allow spritesmith types import

  • fix: Add a test for new types import for spritesmith

Created at 1 hour ago
pull request closed
Allow spritesmith types import

Please fill in this template.

Select one of these and delete the others:

If changing an existing definition:

  • [x] Provide a URL to documentation or source code which provides context for the suggested changes: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64124#issuecomment-1411073621
  • [x] If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the header.
Created at 1 hour ago
Allow spritesmith types import

Ready to merge

Created at 1 hour ago
Allow spritesmith types import

@Zenoo: Everything looks good here. I am ready to merge this PR (at 5ae2616) on your behalf whenever you think it's ready.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! :heart:

Created at 1 hour ago

🤖 Merge PR #64156 jws support 'json' option for decode by @loucadufault

This is supported in the library but not by the types: https://github.com/auth0/node-jws/blob/master/index.js#L15

Created at 1 hour ago
pull request closed
jws support 'json' option for decode

This is supported in the library but not by the types: https://github.com/auth0/node-jws/blob/master/index.js#L15

Please fill in this template.

Select one of these and delete the others:

If changing an existing definition:

  • [X] Provide a URL to documentation or source code which provides context for the suggested changes: node-jws/index.js#L15 > node-jws/lib/verify-stream.js#L57
  • [ ] If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the header.
Created at 1 hour ago
jws support 'json' option for decode

Ready to merge

Created at 1 hour ago

Using full words in the support table for better accessibility (#64170)

Created at 2 hours ago
Allow spritesmith types import

🔔 @Zenoo — you're the only owner, but it would still be good if you find someone to review this PR in the next few days, otherwise a maintainer will look at it. (And if you do find someone, maybe even recruit them to be a second owner to make future changes easier...)

Created at 2 hours ago
pull request closed
[office-js, office-js-preview] Using full words in the support table for better accessibility

Please fill in this template.

Select one of these and delete the others:

If changing an existing definition:

  • [x] Provide a URL to documentation or source code which provides context for the suggested changes: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64091#issuecomment-1404392076
  • [ ] If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the header.
Created at 2 hours ago
Allow spritesmith types import

@Zenoo Thank you for submitting this PR!

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

Because you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • 🕐 Continuous integration tests are still running
  • 🕐 Most recent commit is approved by type definition owners, DT maintainers or others

Once every item on this list is checked, I'll ask you for permission to merge and publish the changes.


{
  "type": "info",
  "now": "-",
  "pr_number": 64172,
  "author": "Zenoo",
  "headCommitOid": "5ae2616e442581cf3b9219e727d6a7e684b22d65",
  "mergeBaseOid": "0d20e71271c585986b5830f2e0866a011d96c7e6",
  "lastPushDate": "2023-01-31T21:25:11.000Z",
  "lastActivityDate": "2023-01-31T21:26:28.000Z",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Well-liked by everyone",
  "pkgInfo": [
    {
      "name": "spritesmith",
      "kind": "edit",
      "files": [
        {
          "path": "types/spritesmith/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/spritesmith/spritesmith-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "Zenoo"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    }
  ],
  "reviews": [],
  "ciResult": "unknown"
}
Created at 2 hours ago
pull request opened
Allow spritesmith types import

Please fill in this template.

Select one of these and delete the others:

If changing an existing definition:

  • [x] Provide a URL to documentation or source code which provides context for the suggested changes: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64124#issuecomment-1411073621
  • [x] If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the header.
Created at 2 hours ago
[spritesmith] Add types

Thanks ! I will open a PR with these modifications

Created at 2 hours ago
[spritesmith] Add types

here you are, put your types into 'namespace' to export, rewritten:

// Type definitions for spritesmith 3.4
// Project: https://github.com/twolfson/spritesmith
// Definitions by: Zenoo <https://github.com/Zenoo>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import { ReadableStream } from 'stream/web';
import { BufferFile } from 'vinyl';

declare class Spritesmith {
    constructor(params?: Spritesmith.SpritesmithParams);
    static run(
        params: Spritesmith.SpritesmithParams & Spritesmith.SpritesmithProcessImagesOptions & {
            src: Spritesmith.SpritesmithCreateImagesSrc;
        },
        callback: (
            err: Error | null,
            result: Spritesmith.SpritesmithResult & {
                image: Buffer;
            }
        ) => void): void;
    createImages(src: Spritesmith.SpritesmithCreateImagesSrc, callback: (err: Error | null, images: SpritesmithImage[]) => void): void;
    processImages(
        images: Spritesmith.SpritesmithImage[],
        options?: Spritesmith.SpritesmithProcessImagesOptions
    ): Spritesmith.SpritesmithResult;
}

declare namespace Spritesmith {
    interface SpritesmithParams {
        engine?: string;
        engineOpts?: Record<string, unknown>;
    }

    type SpritesmithCreateImagesSrc = Array<string | BufferFile>;
    interface SpritesmithImage {
        width: number;
        height: number;
        [key: string]: unknown;
    }

    interface SpritesmithProcessImagesOptions {
        padding?: number;
        exportOpts?: {
            format?: 'png' | 'jpg' | 'jpeg' | 'webp';
            quality?: number;
            background?: string;
            [key: string]: unknown;
        };
        algorithm?: 'top-down' | 'left-right' | 'diagonal' | 'alt-diagonal' | 'binary-tree';
        algorithmOpts?: {
            sort?: boolean;
        };
    }

    interface SpritesmithResult {
        image: ReadableStream;
        coordinates: Record<string, { x: number; y: number; width: number; height: number }>;
        properties: { width: number; height: number };
    }
}

export = Spritesmith;

usage, e.g.:

import Spritesmith, {
    SpritesmithCreateImagesSrc,
    SpritesmithImage,
    SpritesmithParams,
    SpritesmithProcessImagesOptions,
    SpritesmithResult
} from 'spritesmith';
Created at 2 hours ago
[spritesmith] Add types

No, I mean, people need to be able to import the every type declared here for use elsewhere.
If for some reason I need to give the type SpritesmithResult to some variable like:

let result: SpritesmithResult | null = null;

It's not possible, since there is no way to import the type SpritesmithResult from the declaration

Created at 2 hours ago
[spritesmith] Add types

image

Created at 2 hours ago
Created at 2 hours ago
[spritesmith] Add types

If one has default (for new TS configs) esModuleInterop option enabled, this works:

import Spritesmith from 'spritesmith';

const sprites = ['fork.png', 'github.png', 'twitter.png'];
Spritesmith.run({ src: sprites }, function handleResult(err, result) {
    result.image;
    result.coordinates;
    result.properties;
});

producing:

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const spritesmith_1 = __importDefault(require("spritesmith"));
const sprites = ['fork.png', 'github.png', 'twitter.png'];
spritesmith_1.default.run({ src: sprites }, function handleResult(err, result) {
    result.image;
    result.coordinates;
    result.properties;
});
Created at 2 hours ago