Skip to content

Commit 5e5e65a

Browse files
author
Vlad Balin
committed
IO Mixin TS type fixes
1 parent 61920af commit 5e5e65a

File tree

12 files changed

+18
-38
lines changed

12 files changed

+18
-38
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/record/io-mixin.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export interface IORecord extends IONode {
1010
set(json: object, options: object): any;
1111
}
1212
export declare const IORecordMixin: {
13-
getEndpoint(this: IORecord): IOEndpoint;
1413
save(this: IORecord, options?: IOOptions): IOPromise<any>;
1514
fetch(options?: IOOptions): IOPromise<any>;
1615
destroy(options?: IOOptions): IOPromise<any>;

lib/record/io-mixin.js

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/record/io-mixin.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/record/record.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export declare class Record extends Transactional implements IORecord, Attribute
2424
_endpoints: {
2525
[name: string]: IOEndpoint;
2626
};
27-
save: (options?: object) => IOPromise<any>;
28-
destroy: (options?: object) => IOPromise<any>;
27+
save(options?: object): IOPromise<any>;
28+
destroy(options?: object): IOPromise<any>;
2929
_previousAttributes: {};
3030
previousAttributes(): AttributesValues;
3131
attributes: AttributesValues;

lib/record/record.js

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/record/record.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/record/io-mixin.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ export interface IORecord extends IONode {
1212
}
1313

1414
export const IORecordMixin = {
15-
getEndpoint( this : IORecord ) : IOEndpoint {
16-
return getOwnerEndpoint( this ) || this._endpoint;
17-
},
18-
1915
save( this : IORecord, options : IOOptions = {} ){
2016
const endpoint = this.getEndpoint(),
2117
json = this.toJSON();

src/record/record.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ export interface RecordDefinition extends TransactionalDefinition {
5050
// Default id attribute name
5151
idAttribute : 'id'
5252
})
53-
@mixins( IORecordMixin )
5453
@definitions({
5554
defaults : mixinRules.merge,
5655
attributes : mixinRules.merge,
@@ -79,10 +78,10 @@ export class Record extends Transactional implements IORecord, AttributesContain
7978
_endpoints : { [ name : string ] : IOEndpoint }
8079

8180
// Save record
82-
save : ( options? : object ) => IOPromise<any>
81+
save( options? : object ) : IOPromise<any> { throw new Error( 'Implemented by mixin' ); }
8382

8483
// Destroy record
85-
destroy : ( options? : object ) => IOPromise<any>
84+
destroy( options? : object ) : IOPromise<any> { throw new Error( 'Implemented by mixin' ); }
8685

8786
/***********************************
8887
* Core Members
@@ -459,7 +458,7 @@ export class Record extends Transactional implements IORecord, AttributesContain
459458
_onChildrenChange : ( child : Transactional, options : TransactionOptions ) => void
460459
};
461460

462-
assign( Record.prototype, UpdateRecordMixin );
461+
assign( Record.prototype, UpdateRecordMixin, IORecordMixin );
463462

464463
/***********************************************
465464
* Helper functions

0 commit comments

Comments
 (0)