@craftercms/studio-ui
Version:
Services, components, models & utils to build CrafterCMS authoring extensions.
107 lines (105 loc) • 3.77 kB
TypeScript
/*
* Copyright (C) 2007-2022 Crafter Software Corporation. All Rights Reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3 as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { Observable } from 'rxjs';
import { ContentTypeField } from '../models/ContentType';
import ContentInstance from '../models/ContentInstance';
import { VersionsResponse } from '../models/Version';
import LookupTable from '../models/LookupTable';
import GlobalState from '../models/GlobalState';
import { SiteConfigurationFile } from '../models/SiteConfigurationFile';
export type CrafterCMSModules = 'studio' | 'engine';
export declare function fetchConfigurationXML(
site: string,
configPath: string,
module: CrafterCMSModules,
environment?: string
): Observable<string>;
export declare function fetchConfigurationDOM(
site: string,
configPath: string,
module: CrafterCMSModules,
environment?: string
): Observable<XMLDocument>;
export declare function fetchConfigurationJSON(
site: string,
configPath: string,
module: CrafterCMSModules,
environment?: string
): Observable<any>;
export declare function writeConfiguration(
site: string,
path: string,
module: CrafterCMSModules,
content: string,
environment?: string
): Observable<boolean>;
interface ActiveTargetingModel {
id: string;
[prop: string]: string;
}
export declare function fetchActiveTargetingModel(site?: string): Observable<ContentInstance>;
export declare function deserializeActiveTargetingModelData<T extends Object>(
data: T,
contentTypeFields: LookupTable<ContentTypeField>
): ContentInstance;
export declare function setActiveTargetingModel(data: any): Observable<ActiveTargetingModel>;
export declare function fetchSiteUiConfig(site: string, environment: string): Observable<string>;
export declare function fetchGlobalMenuItems(): Observable<GlobalState['globalNavigation']['items']>;
export declare function fetchProductLanguages(): Observable<
{
id: string;
label: string;
}[]
>;
export declare function fetchHistory(
site: string,
path: string,
environment: string,
module: string
): Observable<VersionsResponse>;
export declare function fetchCannedMessage(site: string, locale: string, type: string): Observable<string>;
export declare function fetchSiteLocale(site: string, environment: string): Observable<any>;
export declare function fetchSiteConfigurationFiles(
site: string,
environment?: string
): Observable<SiteConfigurationFile[]>;
export interface StudioSiteConfig {
site: string;
cdataEscapedFieldPatterns: string[];
upload: {
timeout: number;
maxActiveUploads: number;
maxSimultaneousUploads: number;
};
locale: {
localeCode: string;
dateTimeFormatOptions: Intl.DateTimeFormatOptions;
};
publishing: {
publishCommentRequired: boolean;
deleteCommentRequired: boolean;
bulkPublishCommentRequired: boolean;
publishByCommitCommentRequired: boolean;
};
}
export declare function fetchSiteConfig(site: string, environment: string): Observable<StudioSiteConfig>;
export interface CannedMessage {
key: string;
title: string;
message: string;
}
export declare function fetchCannedMessages(site: string, environment: string): Observable<CannedMessage[]>;
export {};