actions-on-google / actions-on-google-nodejs

Node.js client library for Actions on Google
https://actions-on-google.github.io/actions-on-google-nodejs
Apache License 2.0
900 stars 197 forks source link

Typescript doesn't compile with `strictNullChecks: true` #438

Open lorenx opened 8 months ago

lorenx commented 8 months ago

Hello. I'm using typescript 5.2.2 and actions-on-google 3.0.0 and when I compile using strictNullChecks: true I encounter the errors shown below. Otherwise, with strictNullChecks: false, everything works fine.

I would like to point out that I'm not using any actionssdk / dialogflow / Conversation stuff, I'm just using smarthome. Thank you.


Errors with strictNullChecks: true:

node_modules/actions-on-google/dist/service/actionssdk/actionssdk.d.ts:51:45 - error TS2344: Type 'TConversation' does not satisfy the constraint 'Conversation<TUserStorage>'.
  Type 'ActionsSdkConversation<TConvData, TUserStorage>' is not assignable to type 'Conversation<TUserStorage>'.
    Types of property '_init' are incompatible.
      Type 'ConversationOptionsInit<TConvData, TUserStorage>' is not assignable to type 'ConversationOptionsInit<{}, TUserStorage>'.

51     catcher: ExceptionHandler<TUserStorage, TConversation>;
                                               ~~~~~~~~~~~~~

node_modules/actions-on-google/dist/service/actionssdk/actionssdk.d.ts:92:51 - error TS2344: Type 'TConversation' does not satisfy the constraint 'Conversation<TUserStorage>'.
  Type 'ActionsSdkConversation<TConvData, TUserStorage>' is not assignable to type 'Conversation<TUserStorage>'.
    Types of property '_init' are incompatible.
      Type 'ConversationOptionsInit<TConvData, TUserStorage>' is not assignable to type 'ConversationOptionsInit<{}, TUserStorage>'.

92     catch(catcher: ExceptionHandler<TUserStorage, TConversation>): this;
                                                     ~~~~~~~~~~~~~

node_modules/actions-on-google/dist/service/actionssdk/conv.d.ts:58:5 - error TS2416: Property '_init' in type 'ActionsSdkConversation<TConvData, TUserStorage>' is not assignable to the same property in base type 'Conversation<TUserStorage>'.
  Type 'ConversationOptionsInit<TConvData, TUserStorage>' is not assignable to type 'ConversationOptionsInit<{}, TUserStorage>'.
    Type 'TConvData' is not assignable to type '{}'.

58     _init: ConversationOptionsInit<TConvData, TUserStorage>;
       ~~~~~

  node_modules/actions-on-google/dist/service/actionssdk/conv.d.ts:25:45
    25 export declare class ActionsSdkConversation<TConvData = JsonObject, TUserStorage = JsonObject> extends Conversation<TUserStorage> {
                                                   ~~~~~~~~~~~~~~~~~~~~~~
    This type parameter might need an `extends {}` constraint.

node_modules/actions-on-google/dist/service/dialogflow/conv.d.ts:148:5 - error TS2416: Property '_init' in type 'DialogflowConversation<TConvData, TUserStorage, TContexts>' is not assignable to the same property in base type 'Conversation<TUserStorage>'.
  Type 'ConversationOptionsInit<TConvData, TUserStorage>' is not assignable to type 'ConversationOptionsInit<{}, TUserStorage>'.

148     _init: ConversationOptionsInit<TConvData, TUserStorage>;
        ~~~~~

node_modules/actions-on-google/dist/service/dialogflow/dialogflow.d.ts:46:45 - error TS2344: Type 'TConversation' does not satisfy the constraint 'Conversation<TUserStorage>'.
  Type 'DialogflowConversation<TConvData, TUserStorage, TContexts>' is not assignable to type 'Conversation<TUserStorage>'.
    Types of property '_init' are incompatible.
      Type 'ConversationOptionsInit<TConvData, TUserStorage>' is not assignable to type 'ConversationOptionsInit<{}, TUserStorage>'.

46     catcher: ExceptionHandler<TUserStorage, TConversation>;
                                               ~~~~~~~~~~~~~

node_modules/actions-on-google/dist/service/dialogflow/dialogflow.d.ts:136:51 - error TS2344: Type 'TConversation' does not satisfy the constraint 'Conversation<TUserStorage>'.
  Type 'DialogflowConversation<TConvData, TUserStorage, TContexts>' is not assignable to type 'Conversation<TUserStorage>'.
    Types of property '_init' are incompatible.
      Type 'ConversationOptionsInit<TConvData, TUserStorage>' is not assignable to type 'ConversationOptionsInit<{}, TUserStorage>'.

136     catch(catcher: ExceptionHandler<TUserStorage, TConversation>): this;