Implementation of utility methods used for tooling.
Home > @acoustic-content-sdk/tooling
tooling package
Implementation of utility methods used for tooling.
Enumerations
Enumeration | Description |
---|---|
ProjectType |
Functions
Function | Description |
---|---|
acceptJsonFile(aFile) | Tests if a file is either a directory or a JSON file |
addToWchToolsDependencies(aDeps, aPkg) | |
blackWhiteList(aInclude, aExclude) | |
bufferToIdentifier(aBuffer) | Converts a buffer to an identifier string |
canHaveLayout(aType) | |
canonicalizeAssets(options) | |
canonicalizeJson(aData) | Performs an inplace canonicalization of a JSON object |
createFileDescriptor(aName, aValue) | |
createGuid(aId, aSecret) | Constructs a GUID in a reproducible way from an ID |
createGuidFromBuffer(aBuffer) | Constructs a GUID in a reproducible way from an ID |
createReadDirectory(aRoot) | |
createRevision(aObj, aSecret) | |
createTypePredicate(aOptions) | |
ensureDirPath(aDir) | |
ensureLeadingSlash(aUrl) | |
ensureTrailingSlash(aUrl) | |
findSdkVersion(aReadFile) | Locates the SDK version |
findSdkVersionFromPkg(aPackage) | Locates the SDK version |
generateDataOverlay(aOptions) | Generates a stream of files for all wchtools data folders references by the addressed module. |
generateKeys(options) | |
generateLayout(options) | |
generateLayouts(options) | |
getOrganization(aPackageName) | Extracts the organization from a package name |
hasTrailingSlash(aUrl) | |
isFileDescriptor(aValue) | Tests if an item is a file descriptor |
logFileDescriptor() | |
relativePath(aSrc, aDst) | |
rxFindAuthoringAssets(aRoot, aTree) | Reads the authoring assets from a directory |
rxFindAuthoringContent(aRoot, aTree) | Reads the authoring types from a directory |
rxFindAuthoringLayoutMappings(aRoot, aTree) | Reads the authoring layouts from a directory |
rxFindAuthoringLayouts(aRoot, aTree) | Reads the authoring layouts from a directory |
rxFindAuthoringTypes(aRoot, aTree) | Reads the authoring types from a directory |
rxFindDataDir(host, options) | |
rxFindPackageJson(aDir, aReadFile) | Loads the package JSON file relative to the directory |
rxFindProject(workspaceOrHost, options) | Locates the workspace project, either from the configured project name, else falls back to the default project |
rxFindProjectName(workspaceOrHost, options) | Locates the workspace project, either from the configured project name, else falls back to the default project |
rxFindWchToolsOptions(host, options) | |
rxGetDependencies(aReadText, aRoot) | Lists all node dependencies of the module |
rxGetWorkspace(aReadText) | |
rxGetWorkspacePath(aReadText) | |
rxLocateRootDir(aBaseDir) | Locates the application root directory based on the working directory |
rxReadAuthoringContent(aRoot, aTree) | Reads the authoring content from a directory |
rxReadAuthoringLayoutMappings(aRoot, aTree) | Reads the authoring layouts from a directory |
rxReadAuthoringLayouts(aRoot, aTree) | Reads the authoring layouts from a directory |
rxReadAuthoringTypes(aRoot, aTree) | Reads the authoring types from a directory |
rxReadBuffer(aFile, aHost) | Reads a JSON file on top of a text callback |
rxReadDir(aBaseDir, aAccept) | Reads all files in the directory and all of its (accepted) subdirectories |
rxReadJsonFile(aFile, aHost) | Reads a JSON file on top of a text callback |
rxWchToolsManifest(aName) | Creates an operator that converts a sequence of files into a manifest |
rxWriteJsonFile(aName, aValue, aHost) | Persist a JSON file |
selectOptionsForTarget(aTarget, aConfiguration) | Returns a selector function that selects the configuration options for a target |
serializeJson(aData) | |
wchToolsCleanup(aItem) | |
wchToolsFileDescriptor(aItem) | Constructs a file descriptor from the item |
writeFiles(aRoot, aOverride) | Returns an operator that writes all file descriptors to disk |
Interfaces
Interface | Description |
---|---|
DataOverlaySchema | |
JsonEntry | |
ReadDirectoryEntry | File descriptor |
WorkspaceProject | |
WorkspaceSchema |
Variables
Variable | Description |
---|---|
anyToBuffer | Converts an arbitrary value into a buffer |
camelCase | |
classCase | |
constantCase | |
createChalkLoggerService | Constructs a chalk based logger |
createReadBuffer | Constructs the read buffer callback |
createReadTextFile | Constructs the read text file callback |
dotCase | |
fixPath | Make sure the path starts with a slash |
kebabCase | |
readTextFile | Generates a ReadTextFile function on top of a ReadBuffer function |
rxDataDirectory | Creates an RX operator that locates data directories in the packages |
rxExists | Tests if a file exists |
rxWriteFileDescriptor | Persists a file descriptor |
TYPE_SUFFIX | |
TYPES_FOLDER | |
WCHTOOLS_DEPENDENCIES | |
WCHTOOLS_FOLDER_ASSET | |
WCHTOOLS_FOLDER_CONTENT_TYPE | |
WCHTOOLS_FOLDER_CONTENT | |
WCHTOOLS_FOLDER_LAYOUT_MAPPING | |
WCHTOOLS_FOLDER_LAYOUT | |
wchToolsGetCredentials | |
writeTextFile | Creates a WriteTextFile function on top of a WriteBuffer function |
Type Aliases
Type Alias | Description |
---|---|
AuthoringItem | |
FileDescriptor | File descriptor, first element is path, second is content |
JsonEntryMap | |
PackageJson | |
ReadBuffer | |
ReadDirectory | Function type to read a directory |
ReadTextFile | |
WriteBuffer | |
WriteTextFile |
Home > @acoustic-content-sdk/tooling > ProjectType
ProjectType enum
Signature:
export declare enum ProjectType
Enumeration Members
Member | Value | Description |
---|---|---|
Application | "application" |
|
Library | "library" |
Home > @acoustic-content-sdk/tooling > acceptJsonFile
acceptJsonFile() function
Tests if a file is either a directory or a JSON file
Signature:
export declare function acceptJsonFile(aFile: ReadDirectoryEntry): boolean;
Parameters
Parameter | Type | Description |
---|---|---|
aFile | ReadDirectoryEntry |
the descriptor |
Returns:
boolean
true if we accept the file or directory
Home > @acoustic-content-sdk/tooling > addToWchToolsDependencies
addToWchToolsDependencies() function
Signature:
export declare function addToWchToolsDependencies(aDeps: string[], aPkg: any): void;
Parameters
Parameter | Type | Description |
---|---|---|
aDeps | string[] |
|
aPkg | any |
Returns:
void
Home > @acoustic-content-sdk/tooling > blackWhiteList
blackWhiteList() function
Signature:
export declare function blackWhiteList(aInclude?: string[], aExclude?: string[]): Predicate<string>;
Parameters
Parameter | Type | Description |
---|---|---|
aInclude | string[] |
|
aExclude | string[] |
Returns:
Predicate<string>
Home > @acoustic-content-sdk/tooling > bufferToIdentifier
bufferToIdentifier() function
Converts a buffer to an identifier string
Signature:
export declare function bufferToIdentifier(aBuffer: Uint8Array): string;
Parameters
Parameter | Type | Description |
---|---|---|
aBuffer | Uint8Array |
the buffer |
Returns:
string
the string
Home > @acoustic-content-sdk/tooling > canHaveLayout
canHaveLayout() function
Signature:
export declare function canHaveLayout(aType: AuthoringType): boolean;
Parameters
Parameter | Type | Description |
---|---|---|
aType | AuthoringType |
Returns:
boolean
Home > @acoustic-content-sdk/tooling > canonicalizeAssets
canonicalizeAssets() function
Signature:
export declare function canonicalizeAssets(options: Schema): (aReadDir: ReadDirectory, logSvc?: LoggerService) => Observable<FileDescriptor<BaseAuthoringItem>>;
Parameters
Parameter | Type | Description |
---|---|---|
options | Schema |
Returns:
(aReadDir: ReadDirectory, logSvc?: LoggerService) => Observable<FileDescriptor<BaseAuthoringItem>>
Home > @acoustic-content-sdk/tooling > canonicalizeJson
canonicalizeJson() function
Performs an inplace canonicalization of a JSON object
Signature:
export declare function canonicalizeJson(aData: any): any;
Parameters
Parameter | Type | Description |
---|---|---|
aData | any |
the JSON object |
Returns:
any
the canonicalized object
Home > @acoustic-content-sdk/tooling > createFileDescriptor
createFileDescriptor() function
Signature:
export declare function createFileDescriptor<T>(aName: string, aValue: T): FileDescriptor<T>;
Parameters
Parameter | Type | Description |
---|---|---|
aName | string |
|
aValue | T |
Returns:
FileDescriptor<T>
Home > @acoustic-content-sdk/tooling > createGuid
createGuid() function
Constructs a GUID in a reproducible way from an ID
Signature:
export declare function createGuid(aId: BinaryLike, aSecret?: string): string;
Parameters
Parameter | Type | Description |
---|---|---|
aId | BinaryLike |
the original ID |
aSecret | string |
some optional secret |
Returns:
string
the guid
Home > @acoustic-content-sdk/tooling > createGuidFromBuffer
createGuidFromBuffer() function
Constructs a GUID in a reproducible way from an ID
Signature:
export declare function createGuidFromBuffer(aBuffer: Buffer): string;
Parameters
Parameter | Type | Description |
---|---|---|
aBuffer | Buffer |
Returns:
string
the guid
Home > @acoustic-content-sdk/tooling > createReadDirectory
createReadDirectory() function
Signature:
export declare function createReadDirectory(aRoot: string): ReadDirectory;
Parameters
Parameter | Type | Description |
---|---|---|
aRoot | string |
Returns:
ReadDirectory
Home > @acoustic-content-sdk/tooling > createRevision
createRevision() function
Signature:
export declare function createRevision(aObj: any, aSecret?: string): string;
Parameters
Parameter | Type | Description |
---|---|---|
aObj | any |
|
aSecret | string |
Returns:
string
Home > @acoustic-content-sdk/tooling > createTypePredicate
createTypePredicate() function
Signature:
export declare function createTypePredicate(aOptions: {
include?: string[];
exclude?: string[];
}): Predicate<AuthoringType>;
Parameters
Parameter | Type | Description |
---|---|---|
aOptions |
{ include?: string[]; exclude?: string[]; }
|
Returns:
Predicate<AuthoringType>
Home > @acoustic-content-sdk/tooling > ensureDirPath
ensureDirPath() function
Signature:
export declare function ensureDirPath(aDir: string): string;
Parameters
Parameter | Type | Description |
---|---|---|
aDir | string |
Returns:
string
Home > @acoustic-content-sdk/tooling > ensureLeadingSlash
ensureLeadingSlash() function
Signature:
export declare function ensureLeadingSlash(aUrl: string): string;
Parameters
Parameter | Type | Description |
---|---|---|
aUrl | string |
Returns:
string
Home > @acoustic-content-sdk/tooling > ensureTrailingSlash
ensureTrailingSlash() function
Signature:
export declare function ensureTrailingSlash(aUrl: string): string;
Parameters
Parameter | Type | Description |
---|---|---|
aUrl | string |
Returns:
string
Home > @acoustic-content-sdk/tooling > findSdkVersion
findSdkVersion() function
Locates the SDK version
Signature:
export declare function findSdkVersion(aReadFile: ReadTextFile): Observable<string>;
Parameters
Parameter | Type | Description |
---|---|---|
aReadFile | ReadTextFile |
read callback |
Returns:
Observable<string>
the SDK version
Home > @acoustic-content-sdk/tooling > findSdkVersionFromPkg
findSdkVersionFromPkg() function
Locates the SDK version
Signature:
export declare function findSdkVersionFromPkg(aPackage: any): string;
Parameters
Parameter | Type | Description |
---|---|---|
aPackage | any |
the package JSON |
Returns:
string
the SDK version or an exception if the SDK versions in the package are inconsistent
Home > @acoustic-content-sdk/tooling > generateDataOverlay
generateDataOverlay() function
Generates a stream of files for all wchtools data folders references by the addressed module.
Signature:
export declare function generateDataOverlay(aOptions: DataOverlaySchema): (aReadText: ReadTextFile, aReadDir: ReadDirectory, aLogSvc?: LoggerService) => Observable<FileDescriptor<Buffer>>;
Parameters
Parameter | Type | Description |
---|---|---|
aOptions | DataOverlaySchema |
options |
Returns:
(aReadText: ReadTextFile, aReadDir: ReadDirectory, aLogSvc?: LoggerService) => Observable<FileDescriptor<Buffer>>
a function that generates the overlay
Remarks
The filenames are relative to the referenced data directories, so they can ba aggregated easily
Home > @acoustic-content-sdk/tooling > generateKeys
generateKeys() function
Signature:
export declare function generateKeys(options: Schema): (aReadDir: ReadDirectory, aLogSvc?: LoggerService) => import("rxjs").Observable<import("../../public_api").FileDescriptor<AuthoringContentItem>>;
Parameters
Parameter | Type | Description |
---|---|---|
options | Schema |
Returns:
(aReadDir: ReadDirectory, aLogSvc?: LoggerService) => import("rxjs").Observable<import("../../public_api").FileDescriptor<AuthoringContentItem>>
Home > @acoustic-content-sdk/tooling > generateLayout
generateLayout() function
Signature:
export declare function generateLayout(options: Schema): (aReadDir: ReadDirectory, logSvc?: LoggerService) => import("rxjs").Observable<import("../../public_api").FileDescriptor<string | Buffer | import("@acoustic-content-sdk/api").AuthoringLayoutMapping | import("@acoustic-content-sdk/api").AuthoringLayoutItem>>;
Parameters
Parameter | Type | Description |
---|---|---|
options | Schema |
Returns:
(aReadDir: ReadDirectory, logSvc?: LoggerService) => import("rxjs").Observable<import("../../public_api").FileDescriptor<string | Buffer | import("@acoustic-content-sdk/api").AuthoringLayoutMapping | import("@acoustic-content-sdk/api").AuthoringLayoutItem>>
Home > @acoustic-content-sdk/tooling > generateLayouts
generateLayouts() function
Signature:
export declare function generateLayouts(options: Schema): (aReadDir: ReadDirectory, logSvc?: LoggerService) => import("rxjs").Observable<import("../../public_api").FileDescriptor<string | Buffer | import("@acoustic-content-sdk/api").AuthoringLayoutMapping | import("@acoustic-content-sdk/api").AuthoringLayoutItem>>;
Parameters
Parameter | Type | Description |
---|---|---|
options | Schema |
Returns:
(aReadDir: ReadDirectory, logSvc?: LoggerService) => import("rxjs").Observable<import("../../public_api").FileDescriptor<string | Buffer | import("@acoustic-content-sdk/api").AuthoringLayoutMapping | import("@acoustic-content-sdk/api").AuthoringLayoutItem>>
Home > @acoustic-content-sdk/tooling > getOrganization
getOrganization() function
Extracts the organization from a package name
Signature:
export declare function getOrganization(aPackageName: string): string;
Parameters
Parameter | Type | Description |
---|---|---|
aPackageName | string |
the package name |
Returns:
string
the organization
Home > @acoustic-content-sdk/tooling > hasTrailingSlash
hasTrailingSlash() function
Signature:
export declare function hasTrailingSlash(aUrl: string): boolean;
Parameters
Parameter | Type | Description |
---|---|---|
aUrl | string |
Returns:
boolean
Home > @acoustic-content-sdk/tooling > isFileDescriptor
isFileDescriptor() function
Tests if an item is a file descriptor
Signature:
export declare function isFileDescriptor<T>(aValue: any): aValue is FileDescriptor<T>;
Parameters
Parameter | Type | Description |
---|---|---|
aValue | any |
the value to test |
Returns:
aValue is FileDescriptor<T>
true if it is a descriptor
Home > @acoustic-content-sdk/tooling > logFileDescriptor
logFileDescriptor() function
Signature:
export declare function logFileDescriptor<T>(): MonoTypeOperatorFunction<FileDescriptor<T>>;
Returns:
MonoTypeOperatorFunction<FileDescriptor<T>>
Home > @acoustic-content-sdk/tooling > relativePath
relativePath() function
Signature:
export declare function relativePath(aSrc: string, aDst: string): string;
Parameters
Parameter | Type | Description |
---|---|---|
aSrc | string |
|
aDst | string |
Returns:
string
Home > @acoustic-content-sdk/tooling > rxFindAuthoringAssets
rxFindAuthoringAssets() function
Reads the authoring assets from a directory
Signature:
export declare function rxFindAuthoringAssets(aRoot: string, aTree: ReadDirectory): Observable<JsonEntry<AuthoringAsset>>;
Parameters
Parameter | Type | Description |
---|---|---|
aRoot | string |
root directory |
aTree | ReadDirectory |
the tree |
Returns:
Observable<JsonEntry<AuthoringAsset>>
the result
Home > @acoustic-content-sdk/tooling > rxFindAuthoringContent
rxFindAuthoringContent() function
Reads the authoring types from a directory
Signature:
export declare function rxFindAuthoringContent(aRoot: string, aTree: ReadDirectory): Observable<JsonEntry<AuthoringContentItem>>;
Parameters
Parameter | Type | Description |
---|---|---|
aRoot | string |
root directory |
aTree | ReadDirectory |
the tree |
Returns:
Observable<JsonEntry<AuthoringContentItem>>
the result
Home > @acoustic-content-sdk/tooling > rxFindAuthoringLayoutMappings
rxFindAuthoringLayoutMappings() function
Reads the authoring layouts from a directory
Signature:
export declare function rxFindAuthoringLayoutMappings(aRoot: string, aTree: ReadDirectory): Observable<JsonEntry<AuthoringLayoutMapping>>;
Parameters
Parameter | Type | Description |
---|---|---|
aRoot | string |
root directory |
aTree | ReadDirectory |
the tree |
Returns:
Observable<JsonEntry<AuthoringLayoutMapping>>
the result
Home > @acoustic-content-sdk/tooling > rxFindAuthoringLayouts
rxFindAuthoringLayouts() function
Reads the authoring layouts from a directory
Signature:
export declare function rxFindAuthoringLayouts(aRoot: string, aTree: ReadDirectory): Observable<JsonEntry<AuthoringLayoutItem>>;
Parameters
Parameter | Type | Description |
---|---|---|
aRoot | string |
root directory |
aTree | ReadDirectory |
the tree |
Returns:
Observable<JsonEntry<AuthoringLayoutItem>>
the result
Home > @acoustic-content-sdk/tooling > rxFindAuthoringTypes
rxFindAuthoringTypes() function
Reads the authoring types from a directory
Signature:
export declare function rxFindAuthoringTypes(aRoot: string, aTree: ReadDirectory): Observable<JsonEntry<AuthoringType>>;
Parameters
Parameter | Type | Description |
---|---|---|
aRoot | string |
root directory |
aTree | ReadDirectory |
the tree |
Returns:
Observable<JsonEntry<AuthoringType>>
the result
Home > @acoustic-content-sdk/tooling > rxFindDataDir
rxFindDataDir() function
Signature:
export declare function rxFindDataDir(host: ReadTextFile, options?: {
data?: string;
}): Observable<string>;
Parameters
Parameter | Type | Description |
---|---|---|
host | ReadTextFile |
|
options |
{ data?: string; }
|
Returns:
Observable<string>
Home > @acoustic-content-sdk/tooling > rxFindPackageJson
rxFindPackageJson() function
Loads the package JSON file relative to the directory
Signature:
export declare function rxFindPackageJson(aDir: string, aReadFile: ReadTextFile): Observable<any>;
Parameters
Parameter | Type | Description |
---|---|---|
aDir | string |
the directory to start on |
aReadFile | ReadTextFile |
the read file callback |
Returns:
Observable<any>
an observable with the file
Home > @acoustic-content-sdk/tooling > rxFindProject
rxFindProject() function
Locates the workspace project, either from the configured project name, else falls back to the default project
Signature:
export declare function rxFindProject<TProjectType extends ProjectType = ProjectType.Application>(workspaceOrHost: WorkspaceSchema | ReadTextFile, options: {
project?: string;
}): Observable<WorkspaceProject<TProjectType>>;
Parameters
Parameter | Type | Description |
---|---|---|
workspaceOrHost | WorkspaceSchema | ReadTextFile |
the workspace root |
options |
{ project?: string; }
|
the options |
Returns:
Observable<WorkspaceProject<TProjectType>>
the project
Home > @acoustic-content-sdk/tooling > rxFindProjectName
rxFindProjectName() function
Locates the workspace project, either from the configured project name, else falls back to the default project
Signature:
export declare function rxFindProjectName(workspaceOrHost: WorkspaceSchema | ReadTextFile, options: {
project?: string;
}): Observable<string>;
Parameters
Parameter | Type | Description |
---|---|---|
workspaceOrHost | WorkspaceSchema | ReadTextFile |
the workspace root |
options |
{ project?: string; }
|
the options |
Returns:
Observable<string>
the project
Home > @acoustic-content-sdk/tooling > rxFindWchToolsOptions
rxFindWchToolsOptions() function
Signature:
export declare function rxFindWchToolsOptions(host: ReadTextFile, options?: {
data?: string;
}): Observable<string>;
Parameters
Parameter | Type | Description |
---|---|---|
host | ReadTextFile |
|
options |
{ data?: string; }
|
Returns:
Observable<string>
Home > @acoustic-content-sdk/tooling > rxGetDependencies
rxGetDependencies() function
Lists all node dependencies of the module
Signature:
export declare function rxGetDependencies(aReadText: ReadTextFile, aRoot?: string): Observable<FileDescriptor<any>>;
Parameters
Parameter | Type | Description |
---|---|---|
aReadText | ReadTextFile |
the read text callback |
aRoot | string |
the root folder |
Returns:
Observable<FileDescriptor<any>>
a listing of the dependencies. The path of the returned FileDescriptor contains the directory of the package, not the name of the package.json
file. The value is the package.json
object.
Home > @acoustic-content-sdk/tooling > rxGetWorkspace
rxGetWorkspace() function
Signature:
export declare function rxGetWorkspace(aReadText: ReadTextFile): Observable<WorkspaceSchema>;
Parameters
Parameter | Type | Description |
---|---|---|
aReadText | ReadTextFile |
Returns:
Observable<WorkspaceSchema>
Home > @acoustic-content-sdk/tooling > rxGetWorkspacePath
rxGetWorkspacePath() function
Signature:
export declare function rxGetWorkspacePath(aReadText: ReadTextFile): Observable<string>;
Parameters
Parameter | Type | Description |
---|---|---|
aReadText | ReadTextFile |
Returns:
Observable<string>
Home > @acoustic-content-sdk/tooling > rxLocateRootDir
rxLocateRootDir() function
Locates the application root directory based on the working directory
Signature:
export declare function rxLocateRootDir(aBaseDir?: string): Observable<string>;
Parameters
Parameter | Type | Description |
---|---|---|
aBaseDir | string |
optionally the base directory, defaults to the current working dir |
Returns:
Observable<string>
the application root
Home > @acoustic-content-sdk/tooling > rxReadAuthoringContent
rxReadAuthoringContent() function
Reads the authoring content from a directory
Signature:
export declare function rxReadAuthoringContent(aRoot: string, aTree: ReadDirectory): Observable<JsonEntryMap<AuthoringContentItem>>;
Parameters
Parameter | Type | Description |
---|---|---|
aRoot | string |
root directory |
aTree | ReadDirectory |
the tree |
Returns:
Observable<JsonEntryMap<AuthoringContentItem>>
the result
Home > @acoustic-content-sdk/tooling > rxReadAuthoringLayoutMappings
rxReadAuthoringLayoutMappings() function
Reads the authoring layouts from a directory
Signature:
export declare function rxReadAuthoringLayoutMappings(aRoot: string, aTree: ReadDirectory): Observable<JsonEntryMap<AuthoringLayoutMapping>>;
Parameters
Parameter | Type | Description |
---|---|---|
aRoot | string |
root directory |
aTree | ReadDirectory |
the tree |
Returns:
Observable<JsonEntryMap<AuthoringLayoutMapping>>
the result
Home > @acoustic-content-sdk/tooling > rxReadAuthoringLayouts
rxReadAuthoringLayouts() function
Reads the authoring layouts from a directory
Signature:
export declare function rxReadAuthoringLayouts(aRoot: string, aTree: ReadDirectory): Observable<JsonEntryMap<AuthoringLayoutItem>>;
Parameters
Parameter | Type | Description |
---|---|---|
aRoot | string |
root directory |
aTree | ReadDirectory |
the tree |
Returns:
Observable<JsonEntryMap<AuthoringLayoutItem>>
the result
Home > @acoustic-content-sdk/tooling > rxReadAuthoringTypes
rxReadAuthoringTypes() function
Reads the authoring types from a directory
Signature:
export declare function rxReadAuthoringTypes(aRoot: string, aTree: ReadDirectory): Observable<JsonEntryMap<AuthoringType>>;
Parameters
Parameter | Type | Description |
---|---|---|
aRoot | string |
root directory |
aTree | ReadDirectory |
the tree |
Returns:
Observable<JsonEntryMap<AuthoringType>>
the result
Home > @acoustic-content-sdk/tooling > rxReadBuffer
rxReadBuffer() function
Reads a JSON file on top of a text callback
Signature:
export declare function rxReadBuffer<T>(aFile: string, aHost: ReadTextFile): Observable<T>;
Parameters
Parameter | Type | Description |
---|---|---|
aFile | string |
filename |
aHost | ReadTextFile |
callback host |
Returns:
Observable<T>
the JSON file
Home > @acoustic-content-sdk/tooling > rxReadDir
rxReadDir() function
Reads all files in the directory and all of its (accepted) subdirectories
Signature:
export declare function rxReadDir(aBaseDir: string, aAccept?: Predicate<ReadDirectoryEntry>): Observable<FileDescriptor<Buffer>>;
Parameters
Parameter | Type | Description |
---|---|---|
aBaseDir | string |
root directory |
aAccept | Predicate<ReadDirectoryEntry> |
function to test if the file is accepted |
Returns:
Observable<FileDescriptor<Buffer>>
a sequence of files in no particular order
Home > @acoustic-content-sdk/tooling > rxReadJsonFile
rxReadJsonFile() function
Reads a JSON file on top of a text callback
Signature:
export declare function rxReadJsonFile<T>(aFile: string, aHost: ReadTextFile): Observable<T>;
Parameters
Parameter | Type | Description |
---|---|---|
aFile | string |
filename |
aHost | ReadTextFile |
callback host |
Returns:
Observable<T>
the JSON file
Home > @acoustic-content-sdk/tooling > rxWchToolsManifest
rxWchToolsManifest() function
Creates an operator that converts a sequence of files into a manifest
Signature:
export declare function rxWchToolsManifest(aName: string): OperatorFunction<FileDescriptor<any>, FileDescriptor<any>>;
Parameters
Parameter | Type | Description |
---|---|---|
aName | string |
the name of the manifest |
Returns:
OperatorFunction<FileDescriptor<any>, FileDescriptor<any>>
the operator
Home > @acoustic-content-sdk/tooling > rxWriteJsonFile
rxWriteJsonFile() function
Persist a JSON file
Signature:
export declare function rxWriteJsonFile(aName: string, aValue: any, aHost: WriteTextFile): Observable<string>;
Parameters
Parameter | Type | Description |
---|---|---|
aName | string |
name of the file |
aValue | any |
value of the file |
aHost | WriteTextFile |
host that can write text files |
Returns:
Observable<string>
the name of the file
Home > @acoustic-content-sdk/tooling > selectOptionsForTarget
selectOptionsForTarget() function
Returns a selector function that selects the configuration options for a target
Signature:
export declare function selectOptionsForTarget(aTarget?: string, aConfiguration?: string): UnaryFunction<WorkspaceProject, JSONObject>;
Parameters
Parameter | Type | Description |
---|---|---|
aTarget | string |
the project target, e.g. 'build' |
aConfiguration | string |
the configuration name, probably more than one configurations |
Returns:
UnaryFunction<WorkspaceProject, JSONObject>
the options
Home > @acoustic-content-sdk/tooling > serializeJson
serializeJson() function
Signature:
export declare function serializeJson(aData: any): string | undefined;
Parameters
Parameter | Type | Description |
---|---|---|
aData | any |
Returns:
string | undefined
Home > @acoustic-content-sdk/tooling > wchToolsCleanup
wchToolsCleanup() function
Signature:
export declare function wchToolsCleanup<T>(aItem: FileDescriptor<T>): FileDescriptor<T>;
Parameters
Parameter | Type | Description |
---|---|---|
aItem | FileDescriptor<T> |
Returns:
FileDescriptor<T>
Home > @acoustic-content-sdk/tooling > wchToolsFileDescriptor
wchToolsFileDescriptor() function
Constructs a file descriptor from the item
Signature:
export declare function wchToolsFileDescriptor<T extends AuthoringItem>(aItem: T | FileDescriptor<T>): FileDescriptor<T>;
Parameters
Parameter | Type | Description |
---|---|---|
aItem | T | FileDescriptor<T> |
the authoring item |
Returns:
FileDescriptor<T>
the descriptor
Home > @acoustic-content-sdk/tooling > writeFiles
writeFiles() function
Returns an operator that writes all file descriptors to disk
Signature:
export declare function writeFiles<T>(aRoot: string, aOverride?: boolean): MonoTypeOperatorFunction<FileDescriptor<T>>;
Parameters
Parameter | Type | Description |
---|---|---|
aRoot | string |
the base of the target file system |
aOverride | boolean |
override flag |
Returns:
MonoTypeOperatorFunction<FileDescriptor<T>>
the operator
Home > @acoustic-content-sdk/tooling > DataOverlaySchema
DataOverlaySchema interface
Signature:
export interface DataOverlaySchema
Properties
Property | Type | Description |
---|---|---|
src | string |
Source folder, uses the root folder if empty |
Home > @acoustic-content-sdk/tooling > JsonEntry
JsonEntry interface
Signature:
export interface JsonEntry<T>
Properties
Property | Type | Description |
---|---|---|
entry | T |
|
id | string |
|
path | string |
Home > @acoustic-content-sdk/tooling > ReadDirectoryEntry
ReadDirectoryEntry interface
File descriptor
Signature:
export interface ReadDirectoryEntry
Properties
Property | Type | Description |
---|---|---|
isDirectory | boolean |
|
path | string |
Home > @acoustic-content-sdk/tooling > WorkspaceProject
WorkspaceProject interface
Signature:
export interface WorkspaceProject<TProjectType extends ProjectType = ProjectType.Application> extends experimental.workspace.WorkspaceProject
Properties
Property | Type | Description |
---|---|---|
architect | WorkspaceTargets<TProjectType> |
Tool options. |
projectType | ProjectType |
Project type. |
targets | WorkspaceTargets<TProjectType> |
Tool options. |
Home > @acoustic-content-sdk/tooling > WorkspaceSchema
WorkspaceSchema interface
Signature:
export interface WorkspaceSchema extends experimental.workspace.WorkspaceSchema
Properties
Property | Type | Description |
---|---|---|
projects |
{ [key: string]: WorkspaceProject<ProjectType.Application | ProjectType.Library>; }
|
Home > @acoustic-content-sdk/tooling > anyToBuffer
anyToBuffer variable
Converts an arbitrary value into a buffer
Signature:
anyToBuffer: (aValue: any) => Buffer
Home > @acoustic-content-sdk/tooling > camelCase
camelCase variable
Signature:
camelCase: (aValue: string) => string
Home > @acoustic-content-sdk/tooling > classCase
classCase variable
Signature:
classCase: (aValue: string) => string
Home > @acoustic-content-sdk/tooling > constantCase
constantCase variable
Signature:
constantCase: (aValue: string) => string
Home > @acoustic-content-sdk/tooling > createChalkLoggerService
createChalkLoggerService variable
Constructs a chalk based logger
Signature:
createChalkLoggerService: () => import("@acoustic-content-sdk/api").LoggerService
Home > @acoustic-content-sdk/tooling > createReadBuffer
createReadBuffer variable
Constructs the read buffer callback
Signature:
createReadBuffer: (aRoot: string) => ReadBuffer
Home > @acoustic-content-sdk/tooling > createReadTextFile
createReadTextFile variable
Constructs the read text file callback
Signature:
createReadTextFile: (aRoot: string) => ReadTextFile
Home > @acoustic-content-sdk/tooling > dotCase
dotCase variable
Signature:
dotCase: (aValue: string) => string
Home > @acoustic-content-sdk/tooling > fixPath
fixPath variable
Make sure the path starts with a slash
Signature:
fixPath: (aPath: string) => string
Home > @acoustic-content-sdk/tooling > kebabCase
kebabCase variable
Signature:
kebabCase: (aValue: string) => string
Home > @acoustic-content-sdk/tooling > readTextFile
readTextFile variable
Generates a ReadTextFile function on top of a ReadBuffer function
Signature:
readTextFile: (aReadBuffer: ReadBuffer, aEncoding?: string) => ReadTextFile
Home > @acoustic-content-sdk/tooling > ReadBuffer
ReadBuffer type
Signature:
export declare type ReadBuffer = UnaryFunction<string, Observable<Buffer>>;
Home > @acoustic-content-sdk/tooling > rxDataDirectory
rxDataDirectory variable
Creates an RX operator that locates data directories in the packages
Signature:
rxDataDirectory: (aReadText: ReadTextFile) => OperatorFunction<FileDescriptor<any>, string>
Home > @acoustic-content-sdk/tooling > rxExists
rxExists variable
Tests if a file exists
Signature:
rxExists: (aFile: string, aRead: UnaryFunction<string, Observable<any>>) => Observable<boolean>
Home > @acoustic-content-sdk/tooling > rxWriteFileDescriptor
rxWriteFileDescriptor variable
Persists a file descriptor
Signature:
rxWriteFileDescriptor: <T>(aWriteBuffer: BiFunction<string, Buffer, Observable<string>>) => MonoTypeOperatorFunction<FileDescriptor<T>>
Home > @acoustic-content-sdk/tooling > TYPE_SUFFIX
TYPE_SUFFIX variable
Signature:
TYPE_SUFFIX = "Type"
Home > @acoustic-content-sdk/tooling > TYPES_FOLDER
TYPES_FOLDER variable
Warning: This API is now obsolete.
Signature:
TYPES_FOLDER = "types"
Home > @acoustic-content-sdk/tooling > WCHTOOLS_DEPENDENCIES
WCHTOOLS_DEPENDENCIES variable
Signature:
WCHTOOLS_DEPENDENCIES = "wchtools-dependencies"
Home > @acoustic-content-sdk/tooling > WCHTOOLS_FOLDER_ASSET
WCHTOOLS_FOLDER_ASSET variable
Signature:
WCHTOOLS_FOLDER_ASSET = "assets"
Home > @acoustic-content-sdk/tooling > WCHTOOLS_FOLDER_CONTENT_TYPE
WCHTOOLS_FOLDER_CONTENT_TYPE variable
Signature:
WCHTOOLS_FOLDER_CONTENT_TYPE = "types"
Home > @acoustic-content-sdk/tooling > WCHTOOLS_FOLDER_CONTENT
WCHTOOLS_FOLDER_CONTENT variable
Signature:
WCHTOOLS_FOLDER_CONTENT = "content"
Home > @acoustic-content-sdk/tooling > WCHTOOLS_FOLDER_LAYOUT_MAPPING
WCHTOOLS_FOLDER_LAYOUT_MAPPING variable
Signature:
WCHTOOLS_FOLDER_LAYOUT_MAPPING = "layout-mappings"
Home > @acoustic-content-sdk/tooling > WCHTOOLS_FOLDER_LAYOUT
WCHTOOLS_FOLDER_LAYOUT variable
Signature:
WCHTOOLS_FOLDER_LAYOUT = "layouts"
Home > @acoustic-content-sdk/tooling > wchToolsGetCredentials
wchToolsGetCredentials variable
Signature:
wchToolsGetCredentials: (aApiUrl: string) => Observable<Credentials>
Home > @acoustic-content-sdk/tooling > writeTextFile
writeTextFile variable
Creates a WriteTextFile function on top of a WriteBuffer function
Signature:
writeTextFile: (aWriteBuffer: BiFunction<string, Buffer, Observable<string>>, aEncoding?: BufferEncoding) => BiFunction<string, string, Observable<string>>
Home > @acoustic-content-sdk/tooling > WriteBuffer
WriteBuffer type
Signature:
export declare type WriteBuffer = BiFunction<string, Buffer, Observable<string>>;
Home > @acoustic-content-sdk/tooling > AuthoringItem
AuthoringItem type
Signature:
export declare type AuthoringItem = AuthoringContentItem | AuthoringType | AuthoringLayoutItem | AuthoringLayoutMapping | AuthoringAsset;
Home > @acoustic-content-sdk/tooling > FileDescriptor
FileDescriptor type
File descriptor, first element is path, second is content
Signature:
export declare type FileDescriptor<T> = [string, T];
Home > @acoustic-content-sdk/tooling > JsonEntryMap
JsonEntryMap type
Signature:
export declare type JsonEntryMap<T> = Record<string, JsonEntry<T>>;
Home > @acoustic-content-sdk/tooling > PackageJson
PackageJson type
Signature:
export declare type PackageJson = JsonSchemaForNpmPackageJsonFiles;
Home > @acoustic-content-sdk/tooling > ReadDirectory
ReadDirectory type
Function type to read a directory
Signature:
export declare type ReadDirectory = (aBaseDir: string, aAccept?: Predicate<ReadDirectoryEntry>) => Observable<FileDescriptor<Buffer>>;
Home > @acoustic-content-sdk/tooling > DataOverlaySchema > src
DataOverlaySchema.src property
Source folder, uses the root folder if empty
Signature:
src?: string;
Home > @acoustic-content-sdk/tooling > ReadDirectoryEntry > isDirectory
ReadDirectoryEntry.isDirectory property
Signature:
isDirectory: boolean;
Home > @acoustic-content-sdk/tooling > ReadDirectoryEntry > path
ReadDirectoryEntry.path property
Signature:
path: string;
Home > @acoustic-content-sdk/tooling > JsonEntry > entry
JsonEntry.entry property
Signature:
entry: T;
Home > @acoustic-content-sdk/tooling > JsonEntry > id
JsonEntry.id property
Signature:
id: string;
Home > @acoustic-content-sdk/tooling > JsonEntry > path
JsonEntry.path property
Signature:
path: string;
Home > @acoustic-content-sdk/tooling > WorkspaceProject > architect
WorkspaceProject.architect property
Tool options.
Signature:
architect?: WorkspaceTargets<TProjectType>;
Home > @acoustic-content-sdk/tooling > WorkspaceProject > projectType
WorkspaceProject.projectType property
Project type.
Signature:
projectType: ProjectType;
Home > @acoustic-content-sdk/tooling > WorkspaceProject > targets
WorkspaceProject.targets property
Tool options.
Signature:
targets?: WorkspaceTargets<TProjectType>;
Home > @acoustic-content-sdk/tooling > WorkspaceSchema > projects
WorkspaceSchema.projects property
Signature:
projects: {
[key: string]: WorkspaceProject<ProjectType.Application | ProjectType.Library>;
};