-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#88 fix test to cover case where "this" property is declared after ty…
…pe literal property and fix the problem Problem fixed creating a getDescriptor function for type literal so that type literal don't modify the declaration node in the scope
- Loading branch information
Showing
3 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
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
14 changes: 14 additions & 0 deletions
14
src/transformer/descriptor/typeLiteral/typeLiteralDeclaration.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import * as ts from 'typescript'; | ||
import { Scope } from '../../scope/scope'; | ||
import { TypeChecker } from '../../typeChecker/typeChecker'; | ||
import { GetMockPropertiesFromSymbol } from '../mock/mockProperties'; | ||
|
||
export function GetTypeLiteralDeclarationDescriptor(node: ts.InterfaceDeclaration, scope: Scope): ts.Expression { | ||
const typeChecker: ts.TypeChecker = TypeChecker(); | ||
const type: ts.Type = typeChecker.getTypeAtLocation(node); | ||
|
||
const properties: ts.Symbol[] = typeChecker.getPropertiesOfType(type); | ||
const signatures: ReadonlyArray<ts.Signature> = type.getCallSignatures(); | ||
|
||
return GetMockPropertiesFromSymbol(properties, signatures, scope); | ||
} |
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