Skip to content

Commit 382eb4f

Browse files
committed
Add note about annotated type signatures
1 parent b8c9b05 commit 382eb4f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ WIP
88

99
The `lit-localize` module exports the following functions:
1010

11+
> Note that lit-localize relies on distinctive, annotated TypeScript type
12+
> signatures to identify calls to `msg` and other APIs during analysis of your
13+
> code. Casting a lit-localize function to a type that does not include its
14+
> annotation will prevent lit-localize from being able to extract and transform
15+
> templates from your application. For example, a cast like
16+
> `(msg as any)("greeting", "Hello")` will not be identified. It is safe to
17+
> re-assign lit-localize functions or pass them as parameters, as long as the
18+
> distinctive type signature is preserved. If needed, you can reference each
19+
> function's distinctive type with e.g. `typeof msg`.
20+
1121
### `configureLocalization(configuration)`
1222

1323
Set runtime localization configuration.

0 commit comments

Comments
 (0)