Skip to content

customCodec - createDecoderCore types problem #3384

@querysmith-sys

Description

@querysmith-sys

i was creating custom codec and i came across a problem related to typescript compilation error when following this Codec Architecture documentation page it is mentioned that createDecoderCore should be configured with onCreate, onAppend, and onUpdate

createDecoder() {
  const core = createDecoderCore({
    onCreate: (msg) => deserialize(msg.data),
    onAppend: (msg) => deserialize(msg.data),
    onUpdate: (msg) => deserialize(msg.data),
  })
}
but when i was writing these , it gave me type error saying: Object literal may only specify known properties, and 'onCreate' does not exist in type 'DecoderCoreHooks<unknown, unknown>'.
 then i checked the types for  DecoderCoreHooks it shows to use buildStartEvents , buildDeltaEvent, and so on.. it contradicts with the previous one or is it renamed and the doc is not updated?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions