solarnetwork-api-core
    Preparing search index...

    Interface StreamedDatum

    Common API for stream and stream aggregate datum.

    interface StreamedDatum {
        date: Date;
        metadata?: DatumStreamMetadata;
        streamId: string;
        tags?: Set<string>;
        toObject:
            | (
                (
                    meta?: DatumStreamMetadata | DatumStreamMetadataRegistry,
                ) => undefined | Record<string, any>
            )
            | (
                (
                    meta?: DatumStreamMetadata | DatumStreamMetadataRegistry,
                    withoutStatistics?: boolean,
                ) => undefined | Record<string, any>
            );
        propertyValuesForType(
            samplesType: DatumSamplesType,
        ): undefined | string[] | number[] | Set<string>;
        toJsonEncoding(registry?: DatumStreamMetadataRegistry): string;
        toJsonObject(registry?: DatumStreamMetadataRegistry): any[];
    }

    Implemented by

    Index

    Properties

    date: Date

    The timestamp.

    Attached metadata.

    streamId: string

    The stream ID.

    tags?: Set<string>

    The tag values.

    toObject:
        | (
            (
                meta?: DatumStreamMetadata | DatumStreamMetadataRegistry,
            ) => undefined | Record<string, any>
        )
        | (
            (
                meta?: DatumStreamMetadata | DatumStreamMetadataRegistry,
                withoutStatistics?: boolean,
            ) => undefined | Record<string, any>
        )

    Get this instance as a simple object.

    The following basic properties will be set on the returned object:

    • streamId - the stream ID
    • date - the timestamp
    • sourceId - the metadata source ID
    • nodeId or locationId - either the node ID or location ID from the metadata
    • tags - any tags (as an Array)

    Beyond that, all instantaneous, accumulating, and status properties will be included. If duplicate property names exist between the different classifications, the first-available value will be used.

    a metadata instance or metadata registry to encode the property names with; falls back to the meta class property if not provided

    if true then omit statistic properties (when available)

    an object populated with all available properties

    Methods

    • Get the property values for a given samples type.

      Parameters

      Returns undefined | string[] | number[] | Set<string>

      the property values for the given type, or undefined if none available