New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate "msg_generated.d.ts" and include in "assets.ts" #510

Closed
kitsonk opened this Issue Aug 12, 2018 · 0 comments

Comments

1 participant
@kitsonk
Contributor

kitsonk commented Aug 12, 2018

Currently, msg_generated.d.ts is hardcoded into assets.ts. There is a todo to remove it in the code, but in actual fact, timers.ts when inlined as timers.d.ts requires it to have a complete public interface. It currently generates:

import { deno as fbs } from "gen/msg_generated";
export declare type TimerCallback = (...args: any[]) => void;
export declare function onMessage(msg: fbs.TimerReady): void;
export declare function setTimeout(cb: TimerCallback, delay: number, ...args: any[]): number;
export declare function setInterval(cb: TimerCallback, delay: number, ...args: any[]): number;
export declare function clearTimer(id: number): void;

It maybe that onMessage is exported for testing purposes, but really isn't part of the public API. If that is the case, we can try to use --stripInternal and mark that function as /** @internal */ in timers.ts and it should be stripped out of the declaration, meaning runtime code would not be able to access that function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment