demo/typescript.js
function filterNamedImportOrExportCompletionItems(exportsOfModule, namedImportsOrExports) {
                var exisingImportsOrExports = {};
                for (var _i = 0; _i < namedImportsOrExports.length; _i++) {
                    var element = namedImportsOrExports[_i];
                    // If this is the current item we are editing right now, do not filter it out
                    if (element.getStart() <= position && position <= element.getEnd()) {
                        continue;
                    }
                    var name_32 = element.propertyName || element.name;
                    exisingImportsOrExports[name_32.text] = true;
                }
                if (ts.isEmpty(exisingImportsOrExports)) {
                    return exportsOfModule;
                }
                return ts.filter(exportsOfModule, function (e) { return !ts.lookUp(exisingImportsOrExports, e.name); });
            }
function filterNamedImportOrExportCompletionItems(exportsOfModule, namedImportsOrExports) {
                var exisingImportsOrExports = {};
                for (var _i = 0; _i < namedImportsOrExports.length; _i++) {
                    var element = namedImportsOrExports[_i];
                    // If this is the current item we are editing right now, do not filter it out
                    if (element.getStart() <= position && position <= element.getEnd()) {
                        continue;
                    }
                    var name_32 = element.propertyName || element.name;
                    exisingImportsOrExports[name_32.text] = true;
                }
                if (ts.isEmpty(exisingImportsOrExports)) {
                    return exportsOfModule;
                }
                return ts.filter(exportsOfModule, function (e) { return !ts.lookUp(exisingImportsOrExports, e.name); });
            }
Filters out completion suggestions for named imports or exports.

@param exportsOfModule          The list of symbols which a module exposes.
@param namedImportsOrExports    The list of existing import/export specifiers in the import/export clause.

@returns Symbols to be suggested at an import/export clause, barring those whose named imports/exports
do not occur at the current position and have not otherwise been typed.