This repository was archived by the owner on May 22, 2025. It is now read-only.
Shared: Added typescript for times helper#17
Open
promaty wants to merge 6 commits into
Open
Conversation
sohkai
reviewed
Nov 13, 2020
| import { Session } from '../models/objection' | ||
|
|
||
| import { HOURS, DAYS } from '@aragon/protocol-backend-shared/helpers/times' | ||
| import { HOURS, DAYS } from '@aragon/protocol-backend-shared/build/helpers/times' |
Contributor
There was a problem hiding this comment.
This may be a dumb question, but when we update these other helpers to be in TS, would we be able to import the source files?
It seems a bit weird to have to do this.
Contributor
Author
There was a problem hiding this comment.
One way to do it would be to define main and types in package.json like I did in ipfs pinner and then have all imports in a single index.ts file:
https://github.com/aragonone/ipfs-pinner/blob/development/packages/shared/src/index.ts
In this case we could import the same thing like this:
import { times } from '@aragon/protocol-backend-shared
const { HOURS, DAYS } = timesI find this more verbose however and you also have to think about multiple imports/exports not just the source file directly.
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Starting with a single lib now, will add others in following PRs