@gooddata/typings
Advanced tools
Comparing version 0.0.4 to 0.0.5-martin.mosko-visualization-object-2018-01-19T14-07-01-174Z
@@ -111,2 +111,15 @@ export declare namespace AFM { | ||
} | ||
type VisualizationStyleType = 'common' | 'table' | 'line' | 'column' | 'bar'; | ||
interface IVisualizationStyle { | ||
visualizationStyle: { | ||
type: VisualizationStyleType; | ||
colorPalette: { | ||
measure?: { | ||
color: string; | ||
periodOverPeriod: string; | ||
}; | ||
stack?: any; | ||
}; | ||
}; | ||
} | ||
interface IMeasureSortItem { | ||
@@ -136,3 +149,132 @@ measureSortItem: { | ||
function isMeasureLocatorItem(locator: AFM.LocatorItem): locator is AFM.IMeasureLocatorItem; | ||
function isPositiveAttributeFilter(filter: AFM.CompatibilityFilter): filter is AFM.IPositiveAttributeFilter; | ||
function isNegativeAttributeFilter(filter: AFM.CompatibilityFilter): filter is AFM.INegativeAttributeFilter; | ||
} | ||
export declare namespace VisualizationObject { | ||
type SortDirection = 'asc' | 'desc'; | ||
type Identifier = string; | ||
type MeasureAggregation = 'sum' | 'count' | 'avg' | 'min' | 'max' | 'median' | 'runsum'; | ||
type TotalType = 'sum' | 'avg' | 'max' | 'min' | 'nat' | 'med'; | ||
type VisualizationType = 'table' | 'line' | 'column' | 'bar' | 'pie' | 'doughnut' | 'combo'; | ||
type BucketItem = IMeasure | IVisualizationAttribute; | ||
type VisualizationObjectFilter = VisualizationObjectDateFilter | VisualizationObjectAttributeFilter; | ||
type VisualizationObjectDateFilter = IVisualizationObjectRelativeDateFilter | IVisualizationObjectAbsoluteDateFilter; | ||
type VisualizationObjectAttributeFilter = IVisualizationObjectPositiveAttributeFilter | IVisualizationObjectNegativeAttributeFilter; | ||
interface IObjUriQualifier { | ||
uri: string; | ||
} | ||
interface IVisualizationObjectPositiveAttributeFilter { | ||
positiveAttributeFilter: { | ||
displayForm: IObjUriQualifier; | ||
in: string[]; | ||
}; | ||
} | ||
interface IVisualizationObjectNegativeAttributeFilter { | ||
negativeAttributeFilter: { | ||
displayForm: IObjUriQualifier; | ||
notIn: string[]; | ||
}; | ||
} | ||
interface IVisualizationObjectAbsoluteDateFilter { | ||
absoluteDateFilter: { | ||
dataSet: IObjUriQualifier; | ||
from?: string; | ||
to?: string; | ||
}; | ||
} | ||
interface IVisualizationObjectRelativeDateFilter { | ||
relativeDateFilter: { | ||
dataSet: IObjUriQualifier; | ||
granularity: string; | ||
from?: number; | ||
to?: number; | ||
}; | ||
} | ||
interface IVisualizationObject { | ||
meta: IVisualizationObjectMeta; | ||
content: IVisualizationObjectContent; | ||
} | ||
interface IVisualization { | ||
visualizationObject: IVisualizationObject; | ||
} | ||
interface IVisualizationObjectResponse { | ||
visualizationObject: IVisualizationObject; | ||
} | ||
interface IVisualizationObjectMeta { | ||
author?: string; | ||
category?: string; | ||
contributor?: string; | ||
created?: Date; | ||
deprecated?: boolean; | ||
identifier?: string; | ||
isProduction?: boolean; | ||
locked?: boolean; | ||
projectTemplate?: string; | ||
sharedWithSomeone?: boolean; | ||
summary?: string; | ||
tags?: string; | ||
title: string; | ||
unlisted?: boolean; | ||
updated?: Date; | ||
uri?: string; | ||
} | ||
interface IVisualizationObjectContent { | ||
visualizationClass: IObjUriQualifier; | ||
buckets: IBucket[]; | ||
filters?: VisualizationObjectFilter[]; | ||
properties?: string; | ||
references?: IReferenceItem[]; | ||
} | ||
interface IReferenceItem { | ||
[identifier: string]: string; | ||
} | ||
interface IBucket { | ||
localIdentifier?: Identifier; | ||
items: BucketItem[]; | ||
totals?: IVisualizationTotal[]; | ||
} | ||
interface IVisualizationTotal { | ||
type: TotalType; | ||
measureIdentifier: string; | ||
attributeIdentifier: string; | ||
alias?: string; | ||
} | ||
interface IMeasure { | ||
measure: { | ||
localIdentifier: Identifier; | ||
definition: IMeasureDefinition | IPoPMeasureDefinition; | ||
alias?: string; | ||
title?: string; | ||
format?: string; | ||
}; | ||
} | ||
interface IVisualizationAttribute { | ||
visualizationAttribute: { | ||
localIdentifier: Identifier; | ||
displayForm: IObjUriQualifier; | ||
alias?: string; | ||
}; | ||
} | ||
interface IMeasureDefinition { | ||
measureDefinition: { | ||
item: IObjUriQualifier; | ||
aggregation?: MeasureAggregation; | ||
filters?: VisualizationObjectFilter[]; | ||
computeRatio?: boolean; | ||
}; | ||
} | ||
interface IPoPMeasureDefinition { | ||
popMeasureDefinition: { | ||
measureIdentifier: Identifier; | ||
popAttribute: IObjUriQualifier; | ||
}; | ||
} | ||
function isMeasure(bucketItem: IMeasure | IVisualizationAttribute): bucketItem is IMeasure; | ||
function isVisualizationAttribute(bucketItem: IMeasure | IVisualizationAttribute): bucketItem is IVisualizationAttribute; | ||
function isMeasureDefinition(definition: IMeasureDefinition | IPoPMeasureDefinition): definition is IMeasureDefinition; | ||
function isAttributeFilter(filter: VisualizationObjectFilter): filter is VisualizationObjectAttributeFilter; | ||
function isPositiveAttributeFilter(filter: VisualizationObjectAttributeFilter): filter is IVisualizationObjectPositiveAttributeFilter; | ||
function isAbsoluteDateFilter(filter: VisualizationObjectDateFilter): filter is IVisualizationObjectAbsoluteDateFilter; | ||
function isAttribute(bucketItem: BucketItem): bucketItem is IVisualizationAttribute; | ||
} | ||
export declare namespace Execution { | ||
@@ -238,1 +380,35 @@ interface IMeasureHeaderItem { | ||
} | ||
export declare namespace VisualizationClass { | ||
interface IVisualizationClassMeta { | ||
author?: string; | ||
category?: string; | ||
contributor?: string; | ||
created?: Date; | ||
deprecated?: boolean; | ||
identifier?: string; | ||
isProduction?: boolean; | ||
locked?: boolean; | ||
projectTemplate?: string; | ||
sharedWithSomeone?: boolean; | ||
summary?: string; | ||
tags?: string; | ||
title: string; | ||
unlisted?: boolean; | ||
updated?: Date; | ||
uri?: string; | ||
} | ||
interface IVisualizationClassContent { | ||
url: string; | ||
icon: string; | ||
iconSelected: string; | ||
checksum: string; | ||
orderIndex?: number; | ||
} | ||
interface IVisualizationClass { | ||
meta: IVisualizationClassMeta; | ||
content: IVisualizationClassContent; | ||
} | ||
interface IVisualizationClassWrapped { | ||
visualizationClass: IVisualizationClass; | ||
} | ||
} |
@@ -30,3 +30,43 @@ "use strict"; | ||
AFM.isMeasureLocatorItem = isMeasureLocatorItem; | ||
function isPositiveAttributeFilter(filter) { | ||
return !!filter.positiveAttributeFilter; | ||
} | ||
AFM.isPositiveAttributeFilter = isPositiveAttributeFilter; | ||
function isNegativeAttributeFilter(filter) { | ||
return !!filter.negativeAttributeFilter; | ||
} | ||
AFM.isNegativeAttributeFilter = isNegativeAttributeFilter; | ||
})(AFM = exports.AFM || (exports.AFM = {})); | ||
var VisualizationObject; | ||
(function (VisualizationObject) { | ||
function isMeasure(bucketItem) { | ||
return bucketItem.measure !== undefined; | ||
} | ||
VisualizationObject.isMeasure = isMeasure; | ||
function isVisualizationAttribute(bucketItem) { | ||
return bucketItem.visualizationAttribute !== undefined; | ||
} | ||
VisualizationObject.isVisualizationAttribute = isVisualizationAttribute; | ||
function isMeasureDefinition(definition) { | ||
return definition.measureDefinition !== undefined; | ||
} | ||
VisualizationObject.isMeasureDefinition = isMeasureDefinition; | ||
function isAttributeFilter(filter) { | ||
return filter.positiveAttributeFilter !== undefined || | ||
filter.negativeAttributeFilter !== undefined; | ||
} | ||
VisualizationObject.isAttributeFilter = isAttributeFilter; | ||
function isPositiveAttributeFilter(filter) { | ||
return filter.positiveAttributeFilter !== undefined; | ||
} | ||
VisualizationObject.isPositiveAttributeFilter = isPositiveAttributeFilter; | ||
function isAbsoluteDateFilter(filter) { | ||
return filter.absoluteDateFilter !== undefined; | ||
} | ||
VisualizationObject.isAbsoluteDateFilter = isAbsoluteDateFilter; | ||
function isAttribute(bucketItem) { | ||
return bucketItem.visualizationAttribute !== undefined; | ||
} | ||
VisualizationObject.isAttribute = isAttribute; | ||
})(VisualizationObject = exports.VisualizationObject || (exports.VisualizationObject = {})); | ||
//# sourceMappingURL=index.js.map |
242
index.ts
@@ -35,3 +35,3 @@ // Copyright (C) 2007-2017, GoodData(R) Corporation. All rights reserved. | ||
} | ||
export type MeasureDefinition = ISimpleMeasureDefinition | IPopMeasureDefinition; | ||
@@ -142,2 +142,17 @@ | ||
export type VisualizationStyleType = 'common' | 'table' | 'line' | 'column' | 'bar'; | ||
export interface IVisualizationStyle { | ||
visualizationStyle: { | ||
type: VisualizationStyleType; | ||
colorPalette: { | ||
measure?: { | ||
color: string; | ||
periodOverPeriod: string; | ||
} | ||
stack?: any | ||
} | ||
}; | ||
} | ||
export interface IMeasureSortItem { | ||
@@ -154,3 +169,3 @@ measureSortItem: { | ||
attributeLocatorItem: { | ||
attributeIdentifier: Identifier, | ||
attributeIdentifier: Identifier; | ||
element: string; | ||
@@ -175,3 +190,3 @@ }; | ||
} | ||
export function isPopMeasureDefinition( | ||
@@ -194,4 +209,187 @@ definition: AFM.ISimpleMeasureDefinition | AFM.IPopMeasureDefinition | ||
} | ||
export function isPositiveAttributeFilter(filter: AFM.CompatibilityFilter): filter is AFM.IPositiveAttributeFilter { | ||
return !!(filter as AFM.IPositiveAttributeFilter).positiveAttributeFilter; | ||
} | ||
export function isNegativeAttributeFilter(filter: AFM.CompatibilityFilter): filter is AFM.INegativeAttributeFilter { | ||
return !!(filter as AFM.INegativeAttributeFilter).negativeAttributeFilter; | ||
} | ||
} | ||
export namespace VisualizationObject { | ||
export type SortDirection = 'asc' | 'desc'; | ||
export type Identifier = string; | ||
export type MeasureAggregation = 'sum' | 'count' | 'avg' | 'min' | 'max' | 'median' | 'runsum'; | ||
export type TotalType = 'sum' | 'avg' | 'max' | 'min' | 'nat' | 'med'; | ||
export type VisualizationType = 'table' | 'line' | 'column' | 'bar' | 'pie' | 'doughnut' | 'combo'; | ||
export type BucketItem = IMeasure | IVisualizationAttribute; | ||
export type VisualizationObjectFilter = VisualizationObjectDateFilter | VisualizationObjectAttributeFilter; | ||
export type VisualizationObjectDateFilter = | ||
IVisualizationObjectRelativeDateFilter | IVisualizationObjectAbsoluteDateFilter; | ||
export type VisualizationObjectAttributeFilter = | ||
IVisualizationObjectPositiveAttributeFilter | IVisualizationObjectNegativeAttributeFilter; | ||
export interface IObjUriQualifier { | ||
uri: string; | ||
} | ||
export interface IVisualizationObjectPositiveAttributeFilter { | ||
positiveAttributeFilter: { | ||
displayForm: IObjUriQualifier; | ||
in: string[]; | ||
}; | ||
} | ||
export interface IVisualizationObjectNegativeAttributeFilter { | ||
negativeAttributeFilter: { | ||
displayForm: IObjUriQualifier; | ||
notIn: string[]; | ||
}; | ||
} | ||
export interface IVisualizationObjectAbsoluteDateFilter { | ||
absoluteDateFilter: { | ||
dataSet: IObjUriQualifier; | ||
from?: string; | ||
to?: string; | ||
}; | ||
} | ||
export interface IVisualizationObjectRelativeDateFilter { | ||
relativeDateFilter: { | ||
dataSet: IObjUriQualifier | ||
granularity: string; | ||
from?: number; | ||
to?: number; | ||
}; | ||
} | ||
export interface IVisualizationObject { | ||
meta: IVisualizationObjectMeta; | ||
content: IVisualizationObjectContent; | ||
} | ||
export interface IVisualization { | ||
visualizationObject: IVisualizationObject; | ||
} | ||
export interface IVisualizationObjectResponse { | ||
visualizationObject: IVisualizationObject; | ||
} | ||
export interface IVisualizationObjectMeta { | ||
author?: string; | ||
category?: string; | ||
contributor?: string; | ||
created?: Date; | ||
deprecated?: boolean; | ||
identifier?: string; | ||
isProduction?: boolean; | ||
locked?: boolean; | ||
projectTemplate?: string; | ||
sharedWithSomeone?: boolean; | ||
summary?: string; | ||
tags?: string; | ||
title: string; | ||
unlisted?: boolean; | ||
updated?: Date; | ||
uri?: string; | ||
} | ||
export interface IVisualizationObjectContent { | ||
visualizationClass: IObjUriQualifier; | ||
buckets: IBucket[]; | ||
filters?: VisualizationObjectFilter[]; | ||
properties?: string; | ||
references?: IReferenceItem[]; | ||
} | ||
export interface IReferenceItem { | ||
[identifier: string]: string; | ||
} | ||
export interface IBucket { | ||
localIdentifier?: Identifier; | ||
items: BucketItem[]; | ||
totals?: IVisualizationTotal[]; | ||
} | ||
export interface IVisualizationTotal { | ||
type: TotalType; | ||
measureIdentifier: string; | ||
attributeIdentifier: string; | ||
alias?: string; | ||
} | ||
export interface IMeasure { | ||
measure: { | ||
localIdentifier: Identifier; | ||
definition: IMeasureDefinition | IPoPMeasureDefinition; | ||
alias?: string; | ||
title?: string; | ||
format?: string; | ||
}; | ||
} | ||
export interface IVisualizationAttribute { | ||
visualizationAttribute: { | ||
localIdentifier: Identifier; | ||
displayForm: IObjUriQualifier; | ||
alias?: string | ||
}; | ||
} | ||
export interface IMeasureDefinition { | ||
measureDefinition: { | ||
item: IObjUriQualifier; | ||
aggregation?: MeasureAggregation; | ||
filters?: VisualizationObjectFilter[]; | ||
computeRatio?: boolean; | ||
}; | ||
} | ||
export interface IPoPMeasureDefinition { | ||
popMeasureDefinition: { | ||
measureIdentifier: Identifier; | ||
popAttribute: IObjUriQualifier; | ||
}; | ||
} | ||
export function isMeasure(bucketItem: IMeasure | IVisualizationAttribute): bucketItem is IMeasure { | ||
return (bucketItem as IMeasure).measure !== undefined; | ||
} | ||
export function isVisualizationAttribute(bucketItem: IMeasure | IVisualizationAttribute) | ||
: bucketItem is IVisualizationAttribute { | ||
return (bucketItem as IVisualizationAttribute).visualizationAttribute !== undefined; | ||
} | ||
export function isMeasureDefinition(definition: IMeasureDefinition | IPoPMeasureDefinition) | ||
: definition is IMeasureDefinition { | ||
return (definition as IMeasureDefinition).measureDefinition !== undefined; | ||
} | ||
export function isAttributeFilter(filter: VisualizationObjectFilter): filter is VisualizationObjectAttributeFilter { | ||
return (filter as IVisualizationObjectPositiveAttributeFilter).positiveAttributeFilter !== undefined || | ||
(filter as IVisualizationObjectNegativeAttributeFilter).negativeAttributeFilter !== undefined; | ||
} | ||
export function isPositiveAttributeFilter(filter: VisualizationObjectAttributeFilter): filter is IVisualizationObjectPositiveAttributeFilter { | ||
return (filter as IVisualizationObjectPositiveAttributeFilter).positiveAttributeFilter !== undefined; | ||
} | ||
export function isAbsoluteDateFilter(filter: VisualizationObjectDateFilter): filter is IVisualizationObjectAbsoluteDateFilter { | ||
return (filter as IVisualizationObjectAbsoluteDateFilter).absoluteDateFilter !== undefined; | ||
} | ||
export function isAttribute(bucketItem: BucketItem): bucketItem is IVisualizationAttribute { | ||
return (bucketItem as IVisualizationAttribute).visualizationAttribute !== undefined; | ||
} | ||
} | ||
export namespace Execution { | ||
@@ -312,1 +510,39 @@ export interface IMeasureHeaderItem { | ||
} | ||
export namespace VisualizationClass { | ||
export interface IVisualizationClassMeta { | ||
author?: string; | ||
category?: string; | ||
contributor?: string; | ||
created?: Date; | ||
deprecated?: boolean; | ||
identifier?: string; | ||
isProduction?: boolean; | ||
locked?: boolean; | ||
projectTemplate?: string; | ||
sharedWithSomeone?: boolean; | ||
summary?: string; | ||
tags?: string; | ||
title: string; | ||
unlisted?: boolean; | ||
updated?: Date; | ||
uri?: string; | ||
} | ||
export interface IVisualizationClassContent { | ||
url: string; | ||
icon: string; | ||
iconSelected: string; | ||
checksum: string; | ||
orderIndex?: number; | ||
} | ||
export interface IVisualizationClass { | ||
meta: IVisualizationClassMeta; | ||
content: IVisualizationClassContent; | ||
} | ||
export interface IVisualizationClassWrapped { | ||
visualizationClass: IVisualizationClass; | ||
} | ||
} |
{ | ||
"name": "@gooddata/typings", | ||
"version": "0.0.4", | ||
"version": "0.0.5-martin.mosko-visualization-object-2018-01-19T14-07-01-174Z", | ||
"description": "TypeScript definition files for GoodData platform", | ||
@@ -5,0 +5,0 @@ "typings": "dist/index.d.ts", |
Sorry, the diff of this file is not supported yet
37586
935