Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

index.d.ts - initializeAdapterInstance function and declarations for adapter types #181

Open
coni2k opened this issue Jan 2, 2017 · 2 comments

Comments

@coni2k
Copy link
Contributor

coni2k commented Jan 2, 2017

  1. initializeAdapterInstance function returns void, instead of the specified adapter's type.
/**
Initializes a single adapter implementation. Initialization means either newing a instance of the
specified interface and then calling "initialize" on it or simply calling "initialize" on the instance
if it already exists.
@param interfaceName {String} The name of the interface to which the adapter to initialize belongs.
@param adapterName {String} - The name of a previously registered adapter to initialize.
@param isDefault=true {Boolean} - Whether to make this the default "adapter" for this interface.
@return {an instance of the specified adapter}
**/
export function initializeAdapterInstance(interfaceName: string, adapterName: string, isDefault?: boolean): void;
  1. Declarations for adapter types (ajax, dataService, modelLibrary, uriBuilder) are missing.

breeze-client: 1.6.2

Not sure how to generate these declarations but if we can discuss about the details, I could try to help.

@dharapvj
Copy link
Contributor

dharapvj commented Feb 5, 2017

Hello,

Any hopes for this getting fixed soon? (I Hope that ) this is a simple issue that the .d.ts file needs to be regenerated properly.

Due to this issue, I end up including breeze-client twice in a strict webpack + typescript world.. once normally and once via webpack imports-loader doubling my download size.

@marcelgood
Copy link
Contributor

I fixed it for the next release. In the meantime, you can just force a cast.

let inst = <Object><any>config.initializeAdapterInstance('uriBuilder', 'json', false);

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

No branches or pull requests

3 participants