Skip to content

feat(types): add base AJAXRequest type definitions - #116

Merged
usernane merged 1 commit into
mainfrom
feat/100-base-type-definitions
Aug 25, 2026
Merged

feat(types): add base AJAXRequest type definitions#116
usernane merged 1 commit into
mainfrom
feat/100-base-type-definitions

Conversation

@usernane

Copy link
Copy Markdown
Owner

Summary

Adds dist/ajaxrequest.d.ts — complete TypeScript type definitions for the AJAXRequest class.

What's included

Class declaration:

  • Constructor with AJAXRequestConfig parameter
  • Static properties: META, CALLBACK_POOLS, BACKOFF
  • Static methods: createXhr(), extractBase(), isValidURL()
  • All instance methods (getters, setters, callback registration/management, retry, send)
  • Deprecated methods marked with @deprecated

Interfaces:

  • AJAXRequestConfig — constructor configuration
  • AJAXResponse — Promise resolve/reject shape
  • RetryConfig — object-form retry configuration
  • CallbackContext, BeforeAjaxContext, ErrorCallbackContext, RetryCallbackContext, RetryEndCallbackContextthis context types for callbacks
  • CallbackObject — object-form callback with id/call/props
  • AJAXRequestMeta, BackoffEnum

Type aliases:

  • HttpMethod, CallbackPoolName, BackoffStrategy, CallbackParam
  • ResponseCallback, BeforeAjaxCallback, AJAXErrorCallback, RetryCallback, RetryEndCallback

Global:

  • declare const ajax: AJAXRequest for UMD/script tag users

Validation

  • tsc --noEmit --strict passes with zero errors
  • Tested with a consumer file covering: constructor, static access, all methods, callbacks with typed this, retry config, Promise return type

Notes

Closes #100

Adds dist/ajaxrequest.d.ts with complete TypeScript declarations:

- AJAXRequest class (constructor, static props/methods, instance methods)
- Static: META, CALLBACK_POOLS, BACKOFF enum, createXhr, extractBase, isValidURL
- Instance: all getters, setters, callback registration, management, retry, send
- Callback context interfaces: CallbackContext, BeforeAjaxContext,
  ErrorCallbackContext, RetryCallbackContext, RetryEndCallbackContext
- Configuration interfaces: AJAXRequestConfig, RetryConfig, AJAXResponse
- Type aliases: HttpMethod, CallbackPoolName, BackoffStrategy, CallbackParam
- Global 'ajax' constant declaration for UMD/script tag usage
- Deprecated methods marked with @deprecated

Validated with tsc --strict --noEmit (zero errors).
@usernane
usernane merged commit 78d6d53 into main Aug 25, 2026
2 of 3 checks passed
@usernane
usernane deleted the feat/100-base-type-definitions branch August 25, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(types): add base AJAXRequest type definitions

1 participant