@malloydata/render 0.0.149 → 0.0.150

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -113,6 +113,7 @@ export declare enum DurationUnit {
113
113
  Hours = "hours",
114
114
  Days = "days"
115
115
  }
116
+ export declare function isDurationUnit(unit: string): unit is DurationUnit;
116
117
  export interface DurationRenderOptions extends TextRenderOptions {
117
118
  duration_unit?: DurationUnit;
118
119
  }
@@ -1,15 +1,20 @@
1
- import { DataColumn, Explore, Field } from '@malloydata/malloy';
1
+ import { AtomicField, DataColumn, Explore, Field } from '@malloydata/malloy';
2
2
  import { HTMLTextRenderer } from './text';
3
3
  import { DurationRenderOptions, DurationUnit, StyleDefaults } from '../data_styles';
4
4
  import { RendererOptions } from '../renderer_types';
5
5
  import { Renderer } from '../renderer';
6
6
  import { RendererFactory } from '../renderer_factory';
7
+ export declare function formatTimeUnit(value: number, unit: DurationUnit, options?: {
8
+ numFormat?: string;
9
+ terse?: boolean;
10
+ }): string;
11
+ export declare function getText(field: AtomicField, value: number, options: {
12
+ durationUnit?: string;
13
+ }): string | null;
7
14
  export declare class HTMLDurationRenderer extends HTMLTextRenderer {
8
15
  readonly options: DurationRenderOptions;
9
16
  constructor(document: Document, options: DurationRenderOptions);
10
- static multiplierMap: Map<DurationUnit, number>;
11
17
  getText(data: DataColumn): string | null;
12
- formatTimeUnit(value: number, unit: DurationUnit): string;
13
18
  }
14
19
  export declare class DurationRendererFactory extends RendererFactory<DurationRenderOptions> {
15
20
  static readonly instance: DurationRendererFactory;