@jargon/platform-sdk-core
Version:
Core components of the Jargon Platform SDK for node.js
70 lines • 2.57 kB
JavaScript
;
/*
* Copyright 2018 Jargon, Inc. or its affiliates. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DefaultResourceManagerFactory = exports.tri = exports.ri = exports.DefaultRenderOptions = exports.DefaultResourceManagerOptions = void 0;
const factory_1 = require("./factory");
exports.DefaultResourceManagerOptions = {
consistentRandom: true,
localesToPreload: [],
trackSelectedVariations: true,
resourceDirectory: './resources',
fallbackLocales: {}
};
exports.DefaultRenderOptions = {
forceNewRandom: false
};
/**
* Helper function for constructing a RenderItem
* @param key The resource key to render
* @param params Optional params for the render operation
* @param options Options for the rendering operation
*/
function ri(key, params, options) {
return {
key,
params: params,
options: options
};
}
exports.ri = ri;
/**
* Helper function for constructing a TypedRenderItem
* @param type The type of resource to render
* @param key The resource key to render
* @param params Optional params for the render operation
* @param options Options for the rendering operation
*/
function tri(type, key, params, options) {
return {
type,
key,
params: params,
options: options
};
}
exports.tri = tri;
exports.DefaultResourceManagerFactory = factory_1.JargonResourceManagerFactory;
__exportStar(require("./defs"), exports);
__exportStar(require("./remoteFactory"), exports);
//# sourceMappingURL=index.js.map