Skip to content

Conversation

@brizental
Copy link
Contributor

@brizental brizental commented Feb 23, 2021

Pull Request checklist

  • Quality: This PR builds and tests run cleanly
    • make test runs without emitting any warnings
    • make lint runs without emitting any errors
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry to HISTORY.rst or an explanation of why it does not need one
    • Any breaking changes to language binding APIs are noted explicitly

Turns out just changing the file extension was easier than providing type declaration files 👀

Reference:

/* eslint-disable */

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// AUTOGENERATED BY glean_parser.  DO NOT EDIT.

import PingType from "@mozilla/glean/webext/private/ping";

/**
 * This is a custom ping
 *
 * Generated from `custom-ping`.
 */
export const customPing = new PingType({
    includeClientId: false,
    sendIfEmpty: false,
    name: "custom-ping",
    reasonCodes: [],
});

/**
 * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
 * incididunt ut labore et dolore magna aliqua.
 * Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
 * aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
 * voluptate velit esse cillum dolore eu fugiat nulla pariatur.
 *
 * Generated from `really-custom-ping`.
 */
export const reallyCustomPing = new PingType({
    includeClientId: true,
    sendIfEmpty: false,
    name: "really-custom-ping",
    reasonCodes: [],
});

/**
 * This is another custom ping
 *
 * Generated from `custom-ping-might-be-empty`.
 */
export const customPingMightBeEmpty = new PingType({
    includeClientId: true,
    sendIfEmpty: true,
    name: "custom-ping-might-be-empty",
    reasonCodes: ["serious", "silly"],
});

Note that Javascript template and Typescript template are the same, the only change is in the file extension (well, and also an extra "use strict" statement on the Javascript template). I have tested that with both sample extension over on the Glean.js project and it worked.

@brizental brizental requested a review from Dexterp37 February 23, 2021 14:48
Copy link
Contributor

@Dexterp37 Dexterp37 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+wc

@brizental brizental merged commit a74a6c1 into main Feb 23, 2021
@brizental brizental deleted the 1692157-typescript branch February 23, 2021 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants