Writing declaration file for module that only exports a string-map
up vote
1
down vote
favorite
I have a non-typescript module that basically only exports a simple object mapping strings to other strings or null, e.g. more or less:
export = {"foo": "FOO", "bar": null };
I try to write a declaration file for that module, and came up with this working solution:
declare const x: { [key: string]: string | null | undefined };
export = x;
However, is there a better way without introducing a fake variable x
?
typescript typescript-typings
add a comment |
up vote
1
down vote
favorite
I have a non-typescript module that basically only exports a simple object mapping strings to other strings or null, e.g. more or less:
export = {"foo": "FOO", "bar": null };
I try to write a declaration file for that module, and came up with this working solution:
declare const x: { [key: string]: string | null | undefined };
export = x;
However, is there a better way without introducing a fake variable x
?
typescript typescript-typings
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a non-typescript module that basically only exports a simple object mapping strings to other strings or null, e.g. more or less:
export = {"foo": "FOO", "bar": null };
I try to write a declaration file for that module, and came up with this working solution:
declare const x: { [key: string]: string | null | undefined };
export = x;
However, is there a better way without introducing a fake variable x
?
typescript typescript-typings
I have a non-typescript module that basically only exports a simple object mapping strings to other strings or null, e.g. more or less:
export = {"foo": "FOO", "bar": null };
I try to write a declaration file for that module, and came up with this working solution:
declare const x: { [key: string]: string | null | undefined };
export = x;
However, is there a better way without introducing a fake variable x
?
typescript typescript-typings
typescript typescript-typings
asked 5 hours ago
user3612643
5461412
5461412
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53370556%2fwriting-declaration-file-for-module-that-only-exports-a-string-map%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown