How to use the createImportClause function from typescript

Find comprehensive JavaScript typescript.createImportClause code examples handpicked from public code repositorys.

135
136
137
138
139
140
141
142
143
144
    if (moduleKind < ts.ModuleKind.ES2015) {
        return ts.createPropertyAccess(ts.createCall(ts.createIdentifier('require'), [], [urlLiteral]), 'default');
    }
    else {
        const importName = ts.createIdentifier(`__NG_CLI_RESOURCE__${resourceImportDeclarations.length}`);
        resourceImportDeclarations.push(ts.createImportDeclaration(undefined, undefined, ts.createImportClause(importName, undefined), urlLiteral));
        return importName;
    }
}
function getDecoratorOrigin(decorator, typeChecker) {
fork icon0
star icon0
watch icon1

14
15
16
17
18
19
20
21
22
23
const ops = [];
const allImports = ast_helpers_1.collectDeepNodes(sourceFile, ts.SyntaxKind.ImportDeclaration);
// We don't need to verify if the symbol is already imported, star imports should be unique.
// Create the new import node.
const namespaceImport = ts.createNamespaceImport(identifier);
const importClause = ts.createImportClause(undefined, namespaceImport);
const newImport = ts.createImportDeclaration(undefined, undefined, importClause, ts.createLiteral(modulePath));
if (target) {
    ops.push(new interfaces_1.AddNodeOperation(sourceFile, target, before ? newImport : undefined, before ? undefined : newImport));
}
fork icon0
star icon0
watch icon1

Other functions in typescript

Sorted by popularity

function icon

typescript.SyntaxKind is the most popular function in typescript (82777 examples)