0.5.0 • Published 2 years ago

write-ts v0.5.0

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
2 years ago

write-ts

Some Example

to define query for a type from another type

const a = factory.createTypeQueryNode(new IdentifierGenerator("someName").generate()) 

// typeof someName       

to define a type as a literal definition

const a = factory.createTypeLiteralNode(undefined) 

//  = {your definition comes here} 

to define a type using keyof / readonly / unique

const a = factory.createTypeOperatorNode(SyntaxKind.KeyOfKeyword,) 

//  = keyof/readonly/unique ...

to define

const a = factory.createTypePredicateNode(undefined, "someName",undefined) 

//  someName is ...

to define a literal type

ts.factory.createTypeLiteralNode(
            [
                ts.factory.createPropertySignature(
                    undefined,
                    "propertySignatureName",
                    undefined,
                    ts.factory.createTypeReferenceNode("tttttttttt")
                )

            ]
        )

// result 
// {
//      propertySignatureName: tttttttttt;·
// }
0.1.0

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.1

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago