forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
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
[SERVICE-875] Create @types module for runtime-based FDC3 #1
Open
bryangaleopenfin
wants to merge
11
commits into
openfin:fdc3
Choose a base branch
from
bryangaleopenfin:dev/bryan/SERVICE-875-fdc3-types
base: fdc3
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[SERVICE-875] Create @types module for runtime-based FDC3 #1
bryangaleopenfin
wants to merge
11
commits into
openfin:fdc3
from
bryangaleopenfin:dev/bryan/SERVICE-875-fdc3-types
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ICE-875-fdc3-types
pjbroadbent
reviewed
Jan 21, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a super-quick one liner description of what FDC3 is, for the DT reviewers? As per the first line and OpenFin. Or link the first mention of FDC3 to fdc3.finos.org.
pjbroadbent
approved these changes
Jan 24, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Notes
The setup in
index.d.ts
doesn't seem optimal, but it's the only solution I've found that allows the global FDC3 object to be imported automatically within thetsconfig
file usingtypes: ["openfin-fdc3-global"]
, and used without VS complaining that I should be using a module import. Basically, any use ofimport
orexport
at the top level inindex.d.ts
will cause TS to regard it as a module, which then means VS complains when we want to just use it as a globalThe comment on
index.d.ts
is adapted from the@types\openfin
index.d.ts
Generation steps
Grab *.d.ts files generated by FDC3 build process (types in this PR were taken from
master
)Remove
connection.d.ts
andvalidation.d.ts
files, and most of the constants ofinternal.d.ts
(all butSystemChannelTransport
,AppChannelTransport
andChannelTransport
), as these expose types we don't want exposed. (There's a few other stray definitions to remove)Remove
@module
declarations as these upset the linterReplace all occurrences of "export declare" with "export", to satisfy the linter
Add
tslint:disable-next-line no-any-union
to line inmain.d.ts
to satisfy linterManually create
index.d.ts
Proposed PR text for DefinitelyTyped
OpenFin is a Chromium-based runtime for authoring financial applications. FDC3 is a standard for allowing interoperation between financial applications.
This PR provides types for the OpenFin implementation of FDC3, which OpenFin applications can use via the
fdc3
object, which is injected into the global namespace. This is similar to how the current@types/openfin
package provides types for the globalfin
object that is available within OpenFin runtime.Though there is currently an
openfin-fdc3
npm package with types, this will soon be deprecated in favour of this automatic injection approach, hence the need for this types package.Please fill in this template.
npm test
.)npm run lint package-name
(ortsc
if notslint.json
is present).Select one of these and delete the others:
If adding a new definition:
.d.ts
files generated via--declaration
dts-gen --dt
, not by basing it on an existing project.tslint.json
should be present and it shouldn't have any additional or disabling of rules. Just content as{ "extends": "dtslint/dt.json" }
. If for reason the some rule need to be disabled, disable it for that line using// tslint:disable-next-line [ruleName]
and not for whole package so that the need for disabling can be reviewed.tsconfig.json
should havenoImplicitAny
,noImplicitThis
,strictNullChecks
, andstrictFunctionTypes
set totrue
.