0.5.0 • Published 6 months ago

write-ts v0.5.0

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
6 months 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

7 months ago

0.3.0

6 months ago

0.2.0

7 months ago

0.5.0

6 months ago

0.4.0

6 months ago

0.3.1

6 months ago

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago