UNPKG

@sitecore/sc-contenthub-webclient-sdk

Version:

Sitecore Content Hub WebClient SDK.

67 lines 2.74 kB
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var CultureLoadOption_1; import { JsonElementType, JsonObject, JsonProperty } from "ta-json"; import { LoadOption } from "./load-options"; let CultureLoadOption = CultureLoadOption_1 = class CultureLoadOption { constructor(param) { var _a; this.loadOption = LoadOption.None; this.cultures = []; if (param == null) { return; } else if (param instanceof CultureLoadOption_1) { this.cultures = [...param.cultures]; this.loadOption = param.loadOption; } else if (param instanceof Array) { this.cultures = [...param]; this.loadOption = this.cultures.length ? LoadOption.Custom : LoadOption.None; } else if (typeof param === "object") { this.cultures = [...((_a = param.cultures) !== null && _a !== void 0 ? _a : [])]; this.loadOption = param.loadOption != null ? param.loadOption : LoadOption.Custom; } else { this.loadOption = param; } } deepClone() { return new CultureLoadOption_1({ cultures: [...this.cultures], loadOption: this.loadOption }); } }; /** * Load no cultures. */ CultureLoadOption.None = new CultureLoadOption_1(LoadOption.None); /** * Load the default culture. */ CultureLoadOption.Default = new CultureLoadOption_1(LoadOption.Default); /** * Load all cultures. */ CultureLoadOption.All = new CultureLoadOption_1(LoadOption.All); __decorate([ JsonProperty("load_option"), __metadata("design:type", Number) ], CultureLoadOption.prototype, "loadOption", void 0); __decorate([ JsonProperty("cultures"), JsonElementType(String), __metadata("design:type", Array) ], CultureLoadOption.prototype, "cultures", void 0); CultureLoadOption = CultureLoadOption_1 = __decorate([ JsonObject(), __metadata("design:paramtypes", [Object]) ], CultureLoadOption); export { CultureLoadOption }; //# sourceMappingURL=culture-load-option.js.map