logdna / logdna-browser

A frontend browser logging and exception capturing library for LogDNA
MIT License
19 stars 14 forks source link

[v2.0.1] Hooks signature has no typings #29

Closed prescience-data closed 2 years ago

prescience-data commented 2 years ago

https://github.com/logdna/logdna-browser/blob/f8e09e76996e3c64bdd53f6b345df476d4086406/src/logdna.d.ts#L88

Would be great to see this typed as:

export type Serializable = string | number | boolean | bigint | object | Error

export interface HookArgs {
  message: Serializable
  level: LogLevel
  lineContext: object
}

export type BeforeSendHook = (args: HookArgs) => HookArgs

and exported for use.

TerryMooreII commented 2 years ago

Great idea, I totally missed adding this type.

logdnabot commented 2 years ago

:tada: This issue has been resolved in version 2.0.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

prescience-data commented 2 years ago

@TerryMooreII

Hey, just a note that the type is not available as a public export:

image

It would be great to also get LogMessage exported as well if possible. 👀