internaldocs-fb-helpers
Advanced tools
Comparing version 1.6.0 to 1.6.1
@@ -9,1 +9,5 @@ /** | ||
}): Promise<void>; | ||
export declare function reportFeatureUsage(args: { | ||
featureName: string; | ||
id: string | null; | ||
}): Promise<void>; |
@@ -17,3 +17,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.reportContentCopied = void 0; | ||
exports.reportFeatureUsage = exports.reportContentCopied = void 0; | ||
const bridge_1 = require("./bridge"); | ||
@@ -23,11 +23,36 @@ function reportContentCopied(args) { | ||
const { textContent } = args; | ||
yield bridge_1.call({ | ||
module: 'feedback', | ||
api: 'reportContentCopied', | ||
args: { | ||
textContent, | ||
}, | ||
}); | ||
try { | ||
yield bridge_1.call({ | ||
module: 'feedback', | ||
api: 'reportContentCopied', | ||
args: { | ||
textContent, | ||
}, | ||
}); | ||
} | ||
catch (_) { | ||
// If bridge isn't available, e.g. in OSS, do nothing | ||
} | ||
}); | ||
} | ||
exports.reportContentCopied = reportContentCopied; | ||
function reportFeatureUsage(args) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { featureName, id } = args; | ||
console.log('used feature'); | ||
try { | ||
yield bridge_1.call({ | ||
module: 'feedback', | ||
api: 'reportFeatureUsage', | ||
args: { | ||
featureName, | ||
id, | ||
}, | ||
}); | ||
} | ||
catch (_) { | ||
// If bridge isn't available, e.g. in OSS, do nothing | ||
} | ||
}); | ||
} | ||
exports.reportFeatureUsage = reportFeatureUsage; |
{ | ||
"name": "internaldocs-fb-helpers", | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"description": "Helper library for including / excluding content from docusaurus websites", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
15896
442