8000 fee 361 by likern · Pull Request #4 · likern/timely · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fee 361 #4

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

Open
wants to merge 43 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
edd5f30
Add typescript to dev dependencies
likern Jan 6, 2022
b59e731
Add tsconfig templates from other projects
likern Jan 6, 2022
62d97dd
Rename all js files in src/ to ts files
likern Jan 6, 2022
260f1c6
Fix imports
likern Jan 6, 2022
ea168c4
file(zone.ts): Fix import
likern Jan 6, 2022
e77b5cf
file(zone.ts): Fix warnings and errors
likern Jan 6, 2022
cf41053
file(settings.ts): Fix warnings and errors
likern Jan 6, 2022
da3cb43
file(luxon.ts): Fix imports
likern Jan 6, 2022
6a5ad7b
file(interval.ts): Fix imports
likern Jan 6, 2022
23b11a0
file(impl/invalid.ts): Add types to constructor
likern Jan 6, 2022
485b0d5
Add type definitions
likern Jan 8, 2022
4dd6c2a
Add types to some util functions
likern Jan 8, 2022
4ecab78
Make Zone as abstract class
likern Jan 8, 2022
b27bb65
SystemZone overrides abstract Zone class
likern Jan 8, 2022
59e13d4
add types to settings default zone
likern Jan 8, 2022
5ce3e35
Convert type check functions to type predicates
likern Jan 8, 2022
a5974ff
file(regexParser): Add types
likern Jan 8, 2022
68410f7
Add types
likern Jan 9, 2022
4b784d6
file(interval): Fixes most type issues
likern Jan 9, 2022
f31fc81
file(info): Add initial types
likern Jan 9, 2022
3a5456d
file(errors): Add types
likern Jan 9, 2022
d7bec28
Update types
likern Jan 12, 2022
474dbe5
file(duration): Mostly resolve type issues
likern Jan 12, 2022
d72511b
Add Intl.ListFormat type definition
likern Jan 14, 2022
fe0b5da
file(conversions): Add types
likern Jan 15, 2022
ee55fa6
file(diff): Add types
likern Jan 16, 2022
6c21451
file(tokenParser): Add types
likern Jan 17, 2022
1086602
file(digits): Improve types
likern Jan 17, 2022
33e6ab4
file(english): Mostly resolve types
likern Jan 17, 2022
2082add
file(util): Mostly resolve types
likern Jan 17, 2022
d74208e
file(IANAZone): Add types, replace cache object to cache map, more st…
likern Jan 18, 2022
3b165fc
file(zoneUtil): fix imports, add types
likern Jan 18, 2022
a27cb71
file(fixedOffsetZone): add types and more strict equals check
likern Jan 18, 2022
7dd0b93
file(invalidZone): add types
likern Jan 18, 2022
9ad4fe5
Add .eslintignore
likern Jan 18, 2022
cf850d9
Add eslint config
likern Jan 18, 2022
ae2f4bf
Add file with utilities functions
likern Jan 18, 2022
e715a2c
Add more types
likern Jan 18, 2022
246d2eb
Update type for parseZoneInfo function
likern Jan 18, 2022
a5a8913
Update Invalid class
likern Jan 18, 2022
6ae5f52
Export general LuxonError
likern Jan 18, 2022
13e95d7
Move some types outside
likern Jan 18, 2022
cdf4408
export from utils
likern Jan 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
lib/
22 changes: 22 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* eslint-disable no-undef */
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2021,
sourceType: "module",
allowReserved: false,
},
env: {
es2021: true,
},
plugins: ["@typescript-eslint"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
],
rules: {
"@typescript-eslint/no-inferrable-types": "off",
},
};
108 changes: 108 additions & 0 deletions @types/intl.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/// <reference no-default-lib="true"/>

declare namespace Intl {
/**
* The locale matching algorithm to use.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation).
*/
type ListFormatLocaleMatcher = "lookup" | "best fit";

/**
* The format of output message.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat#parameters).
*/
type ListFormatType = "conjunction" | "disjunction" | "unit";

/**
* The length of the formatted message.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat#parameters).
*/
type ListFormatStyle = "long" | "short" | "narrow";

/**
* An object with some or all properties of the `Intl.ListFormat` constructor `options` parameter.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat#parameters).
*/
interface ListFormatOptions {
/** The locale matching algorithm to use. For information about this option, see [Intl page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation). */
localeMatcher?: ListFormatLocaleMatcher;
/** The format of output message. */
type?: ListFormatType;
/** The length of the internationalized message. */
style?: ListFormatStyle;
}

interface ListFormat {
/**
* Returns a string with a language-specific representation of the list.
*
* @param list - An iterable object, such as an [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).
*
* @throws `TypeError` if `list` includes something other than the possible values.
*
* @returns {string} A language-specific formatted string representing the elements of the list.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/format).
*/
format(list: Iterable<string>): string;

/**
* Returns an Array of objects representing the different components that can be used to format a list of values in a locale-aware fashion.
*
* @param list - An iterable object, such as an [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array), to be formatted according to a locale.
*
* @throws `TypeError` if `list` includes something other than the possible values.
*
* @returns {{ type: "element" | "literal", value: string; }[]} An Array of components which contains the formatted parts from the list.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/formatToParts).
*/
formatToParts(list: Iterable<string>): { type: "element" | "literal"; value: string }[];
}

const ListFormat: {
prototype: ListFormat;

/**
* Creates [Intl.ListFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat) objects that
* enable language-sensitive list formatting.
*
* @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings.
* For the general form and interpretation of the `locales` argument,
* see the [`Intl` page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).
*
* @param options - An [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat#parameters)
* with some or all options of `ListFormatOptions`.
*
* @returns [Intl.ListFormatOptions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat) object.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat).
*/
new (locales?: BCP47LanguageTag | BCP47LanguageTag[], options?: ListFormatOptions): ListFormat;

/**
* Returns an array containing those of the provided locales that are
* supported in list formatting without having to fall back to the runtime's default locale.
*
* @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings.
* For the general form and interpretation of the `locales` argument,
* see the [`Intl` page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).
*
* @param options - An [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/supportedLocalesOf#parameters).
* with some or all possible options.
*
* @returns An array of strings representing a subset of the given locale tags that are supported in list
* formatting without having to fall back to the runtime's default locale.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/supportedLocalesOf).
*/
supportedLocalesOf(
locales: BCP47LanguageTag | BCP47LanguageTag[],
options?: Pick<ListFormatOptions, "localeMatcher">
): BCP47LanguageTag[];
};
}
7 changes: 7 additions & 0 deletions configs/typescript/tsconfig.mobile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.package.json",
"compilerOptions": {
"noEmit": true,
"composite": true
}
}
33 changes: 33 additions & 0 deletions configs/typescript/tsconfig.package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"compilerOptions": {
"baseUrl": ".",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"module": "ES2020",
"moduleResolution": "node",
"resolveJsonModule": true,
"target": "esnext",
"lib": [
"ES2021"
],
"jsx": "react-jsx",
"composite": true,
"strict": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noImplicitUseStrict": false,
"noStrictGenericChecks": false,
"noUnusedLocals": true,
"noUnusedParameters": true,
"isolatedModules": true,
"preserveValueImports": true,
"importsNotUsedAsValues": "error"
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"prettier": "^2.3.2",
"rollup": "^2.52.7",
"rollup-plugin-terser": "^7.0.2",
"typescript": "=4.5.4",
"uglify-js": "^3.13.10"
},
"main": "build/node/luxon.js",
Expand Down
File renamed without changes.
Loading
0