GithubHelp home page GithubHelp logo

Comments (6)

felixfbecker avatar felixfbecker commented on August 16, 2024 6

Here are some definitions I wrote for a project (some options are missing):

declare module 'lightstep-tracer' {
    import * as opentracing from 'opentracing'

    export interface TracerOptions {
        /** the project access token */
        access_token: string

        /** the string identifier for the application, service, or process */
        component_name: string

        /**
         * controls the level of logging to the console
         *
         * - 0 - the client library will never log to the console
         * - 1 - error reporting will be throttled to the first error per minute
         * - 2 - all errors are logged to the console
         * - 3 - all errors, warnings, and info statements are logged to the console
         * - 4 - all log statements, including debugging details
         *
         * @default 1
         */
        verbosity?: number

        /** custom collector hostname */
        collector_host?: string

        /** custom collector port */

        collector_port?: number
        /** custom collector base path (if served behind a reverse proxy) */
        collector_path?: string
    }

    export class Tracer extends opentracing.Tracer {
        constructor(options: TracerOptions)

        public startSpan(name: string, options?: opentracing.SpanOptions): Span
    }

    class Span extends opentracing.Span {
        public generateTraceURL(): string
    }
}

from lightstep-tracer-javascript.

bcronin avatar bcronin commented on August 16, 2024 1

@DeTeam , admittedly I'm not a TypeScript expert but if it's conventional to host typedefs along with the JS code, I'd be glad to accept the addition!

from lightstep-tracer-javascript.

mlavina avatar mlavina commented on August 16, 2024 1

@felixfbecker
Any chance you can add this to DefinitelyTyped or make a PR to this package to add a index,d.ts file?

from lightstep-tracer-javascript.

ruiaraujo avatar ruiaraujo commented on August 16, 2024

@bcronin a nice way to get correct type is to have the project in typescript. 😄

from lightstep-tracer-javascript.

felixfbecker avatar felixfbecker commented on August 16, 2024

@mlavina you're welcome to take my code above and do that :)

from lightstep-tracer-javascript.

keeganwitt avatar keeganwitt commented on August 16, 2024

Since the above MR is merged, can this issue be closed?

from lightstep-tracer-javascript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.