feat: 🎸 add runtime typings

 Closes: Closes #43
This commit is contained in:
Christian Kaisermann 2020-01-23 10:11:04 -03:00
parent 31b556bc3f
commit 7bf47d8790
8 changed files with 20 additions and 24 deletions

6
.gitignore vendored
View File

@ -2,4 +2,8 @@ node_modules
*.log
dist/
coverage/
/types/
<<<<<<< HEAD
/types/
=======
types/
>>>>>>> feat: 🎸 add runtime typings

View File

@ -1,5 +1,5 @@
import { getClientLocale } from '../../../src/client/includes/getClientLocale'
import { flatObj } from '../../../src/client/includes/flatObj'
import { getClientLocale } from '../../../src/runtime/includes/getClientLocale'
import { flatObj } from '../../../src/runtime/includes/flatObj'
describe('getting client locale', () => {
beforeEach(() => {

View File

@ -5,7 +5,7 @@ import {
getLocaleDictionary,
$dictionary,
} from '../../src/runtime/stores/dictionary'
import { $format } from '../../src/runtime/stores/format'
import { $format } from '../../src/runtime/stores/formatters'
test('defineMessages returns the identity of its first argument', () => {
const obj = {}

View File

@ -1,10 +1,4 @@
<<<<<<< HEAD:test/runtime/stores/format.test.ts
import { Formatter } from '../../../src/runtime/types'
import { $format } from '../../../src/runtime/stores/format'
import { init } from '../../../src/runtime/configs'
import { addMessages } from '../../../src/runtime/stores/dictionary'
import { $locale } from '../../../src/runtime/stores/locale'
=======
import { get } from 'svelte/store'
import {
@ -12,17 +6,16 @@ import {
$formatTime,
$formatDate,
$formatNumber,
} from '../../../src/client/stores/formatters'
import { init } from '../../../src/client/configs'
import { addMessages } from '../../../src/client/stores/dictionary'
import { $locale } from '../../../src/client/stores/locale'
import { MessageFormatter } from '../../../src/client/types'
import {
} from '../../../src/runtime/stores/formatters'
import { init } from '../../../src/runtime/configs'
import { addMessages } from '../../../src/runtime/stores/dictionary'
import { $locale } from '../../../src/runtime/stores/locale'
import { MessageFormatter ,
TimeFormatter,
DateFormatter,
NumberFormatter,
} from '../../../src/client/types/index'
>>>>>>> feat: 🎸 make date,time and number formatters tree-shakeable:test/client/stores/formatters.test.ts
} from '../../../src/runtime/types'
let formatMessage: MessageFormatter
let formatTime: TimeFormatter

View File

@ -8,11 +8,10 @@ import {
getCurrentLocale,
$locale,
isRelatedLocale,
} from '../../../src/client/stores/locale'
import { getOptions, init } from '../../../src/client/configs'
import { register } from '../../../src/client'
import { hasLocaleQueue } from '../../../src/client/includes/loaderQueue'
import { getClientLocale } from '../../../src/client/includes/getClientLocale'
} from '../../../src/runtime/stores/locale'
import { getOptions, init } from '../../../src/runtime/configs'
import { register } from '../../../src/runtime'
import { hasLocaleQueue } from '../../../src/runtime/includes/loaderQueue'
beforeEach(() => {
init({ fallbackLocale: undefined })