Skip to content

Commit

Permalink
🐛 bug: split vue-template-compiler shim definition from index.d.ts (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Dec 18, 2019
1 parent 36c2b2e commit 92c4dff
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
4 changes: 3 additions & 1 deletion src/infuser.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { SFCDescriptor, SFCBlock } from 'vue-template-compiler'
/* eslint-disable-next-line */
/// <reference path="../types/shims-vue-template-compiler.d.ts"/>
import { SFCBlock, SFCDescriptor } from 'vue-template-compiler'
import { Locale, MetaLocaleMessage, SFCI18nBlock, SFCFileInfo, FormatOptions } from '../types'

import { escape, reflectSFCDescriptor, parseContent, stringifyContent } from './utils'
Expand Down
12 changes: 0 additions & 12 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { SFCDescriptor } from 'vue-template-compiler'

/**
* Locale Message Recursive Structure
* e.g.
Expand Down Expand Up @@ -195,13 +193,3 @@ export interface ProviderConfiguration<T = {}> {
}

export type ProviderConfigurationValue<T = {}> = T & { [prop: string]: unknown }

// extend for vue-i18n-locale-message
declare module 'vue-template-compiler' {
interface SFCDescriptor {
raw: string
contentPath: string
component: string
hierarchy: string[]
}
}
11 changes: 11 additions & 0 deletions types/shims-vue-template-compiler.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { SFCDescriptor } from 'vue-template-compiler'

// extend for vue-i18n-locale-message
declare module 'vue-template-compiler/types/index' {
export interface SFCDescriptor {
raw: string
contentPath: string
component: string
hierarchy: string[]
}
}

0 comments on commit 92c4dff

Please sign in to comment.