Closed zbynekstara closed 5 months ago
Improves the types definition of jointjs so that we do not need to rebuild the file every time we make a change.
types
dist/joint.d.ts
joint.d.ts
@microsoft/api-extractor
yarn run build
yarn run dist
typescript
4.8.4
@microsoft/api-extractor@7.33.7
TODO:
jointjs
tsconfig.common.json
tsconfig.json
type ...
export declare type ...
interface ...
export declare interface ...
export type ...
export const ...
export declare const ...
export function ...
export declare function ...
export class ...
export declare class ...
export namespace ...
export declare namespace ...
export interface ...
enum ...
export enum ...
class ...
namespace ...
function ...
export var ...
var ...
export { }
Description
Improves the types definition of jointjs so that we do not need to rebuild the file every time we make a change.
Motivation and Context
types
reference in package.json to point to it instead ofdist/joint.d.ts
joint.d.ts
via an automated process involving@microsoft/api-extractor
as part ofyarn run build
/yarn run dist
commandtypescript
version throughout the project to4.8.4
to match the version used by@microsoft/api-extractor@7.33.7
TODO:
jointjs
via ESMtsconfig.common.json
insidetsconfig.json
as possibledist/joint.d.ts
is equivalent to olddist/joint.d.ts
(exports are slightly different in the new file)type ...
->export declare type ...
interface ...
->export declare interface ...
export type ...
->export declare type ...
export const ...
->export declare const ...
export function ...
->export declare function ...
export class ...
->export declare class ...
export namespace ...
->export declare namespace ...
(all contents get exported)interface ...
-> internalexport interface ...
type ...
-> internalexport type ...
enum ...
-> internalexport enum ...
class ...
-> internalexport class ...
namespace ...
-> internalexport namespace ...
function ...
-> internalexport function ...
export var ...
-> internalvar ...
(is ok inside export declare)export { }
added at the end (is ok)dist/joint.d.ts
behaves as olddist/joint.d.ts
when used directlydist/joint.d.ts
produces errors - these disappear whendist/joint.d.ts
is used everywhere within an example