Aller-Couleur / handlebars-i18n

handlebars-i18next.js adds the internationalization features of i18next and Intl to handlebars.js
Other
16 stars 6 forks source link

Typedefs and TypeScript example #54

Closed DiefBell closed 1 year ago

DiefBell commented 1 year ago

Not 100% sure on the language/locale codes, nor what all of the possible options/combinations are for DateTimeFormat options, but does what it needs to

fwalzel commented 1 year ago

Hi, Thank you for adding a typescript example. Nice! I am just reviewing it. Trying to run $ npm run example:ts I still get

../../dist/handlebars-i18n.d.ts:1:15 - error TS2305: Module '"handlebars"' has no exported member 'Handlebars'.

import type { Handlebars } from "handlebars";

I am not quite sure what this means. Handlebars’ index.d.ts export seems fine:

declare module "handlebars" {
  export = Handlebars;
}

declare module "handlebars/runtime" {
  export = Handlebars;
}

Can you maybe help here? Thank you!

DiefBell commented 1 year ago

I'm not entirely sure how my TypeScript didn't pick up on that issue... It's been a bit weird lately. Fixed it now

fwalzel commented 1 year ago

Just fixed it :)