kibana/packages/kbn-handlebars/index.ts
Thomas Watson b8d278c066
[8.6] [@kbn/handlebars] Split index.ts into several files (#150230) (#150422)
# Backport

This will backport the following commits from `main` to `8.6`:
- [[@kbn/handlebars] Split index.ts into several files
(#150230)](https://github.com/elastic/kibana/pull/150230)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Thomas
Watson","email":"watson@elastic.co"},"sourceCommit":{"committedDate":"2023-02-07T09:39:10Z","message":"[@kbn/handlebars]
Split index.ts into several files (#150230)\n\nAn attempt to make the
code a little bit easier to
parse","sha":"eafa5e7f0536715e26d71c3e104525ddd7551a14","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","v8.7.0"],"number":150230,"url":"https://github.com/elastic/kibana/pull/150230","mergeCommit":{"message":"[@kbn/handlebars]
Split index.ts into several files (#150230)\n\nAn attempt to make the
code a little bit easier to
parse","sha":"eafa5e7f0536715e26d71c3e104525ddd7551a14"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/150230","number":150230,"mergeCommit":{"message":"[@kbn/handlebars]
Split index.ts into several files (#150230)\n\nAn attempt to make the
code a little bit easier to
parse","sha":"eafa5e7f0536715e26d71c3e104525ddd7551a14"}}]}] BACKPORT-->
2023-02-07 05:56:55 -07:00

30 lines
1 KiB
TypeScript

/*
* Elasticsearch B.V licenses this file to you under the MIT License.
* See `packages/kbn-handlebars/LICENSE` for more information.
*/
import { Handlebars } from './src/handlebars';
import { allowUnsafeEval } from './src/utils';
// The handlebars module uses `export =`, so it can't be re-exported using `export *`.
// However, because of Babel, we're not allowed to use `export =` ourselves.
// So we have to resort to using `exports default` even though eslint doesn't like it.
//
// eslint-disable-next-line import/no-default-export
export default Handlebars;
/**
* If the `unsafe-eval` CSP is set, this string constant will be `compile`,
* otherwise `compileAST`.
*
* This can be used to call the more optimized `compile` function in
* environments that support it, or fall back to `compileAST` on environments
* that don't.
*/
export const compileFnName: 'compile' | 'compileAST' = allowUnsafeEval() ? 'compile' : 'compileAST';
export type {
DecoratorFunction,
ExtendedCompileOptions,
ExtendedRuntimeOptions,
} from './src/types';