Skip to content

Commit 9801771

Browse files
authored
Merge pull request #38 from DickSmith/master
Fix for #37
2 parents 1308dfa + ff5d16d commit 9801771

File tree

9 files changed

+149
-89
lines changed

9 files changed

+149
-89
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ node_modules
2121
.idea/
2222
*.DS_Store
2323
bin
24-
!webpack.*.js
24+
!webpack.*.js
25+
!BEMCheckBox.d.ts

BEMCheckBox.d.ts

Lines changed: 117 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,134 +1,192 @@
1+
/// <reference path="./node_modules/tns-platform-declarations/ios.d.ts" />
12

23
declare class BEMAnimationManager extends NSObject {
34

4-
static alloc(): BEMAnimationManager; // inherited from NSObject
5+
static alloc(): BEMAnimationManager; // inherited from NSObject
56

6-
static new(): BEMAnimationManager; // inherited from NSObject
7+
static new(): BEMAnimationManager; // inherited from NSObject
78

8-
animationDuration: number;
9+
animationDuration: number;
910

10-
constructor(); // inherited from NSObject
11+
constructor(o: { animationDuration: number; });
1112

12-
constructor(o: { animationDuration: number; });
13+
fillAnimationWithBouncesAmplitudeReverse(bounces: number, amplitude: number, reverse: boolean): CAKeyframeAnimation;
1314

14-
fillAnimationWithBouncesAmplitudeReverse(bounces: number, amplitude: number, reverse: boolean): CAKeyframeAnimation;
15+
initWithAnimationDuration(animationDuration: number): this;
1516

16-
morphAnimationFromPathToPath(fromPath: UIBezierPath, toPath: UIBezierPath): CABasicAnimation;
17+
morphAnimationFromPathToPath(fromPath: UIBezierPath, toPath: UIBezierPath): CABasicAnimation;
1718

18-
opacityAnimationReverse(reverse: boolean): CABasicAnimation;
19+
opacityAnimationReverse(reverse: boolean): CABasicAnimation;
1920

20-
self(): BEMAnimationManager; // inherited from NSObjectProtocol
21-
22-
strokeAnimationReverse(reverse: boolean): CABasicAnimation;
21+
strokeAnimationReverse(reverse: boolean): CABasicAnimation;
2322
}
2423

2524
declare const enum BEMAnimationType {
2625

27-
Stroke = 0,
26+
Stroke = 0,
2827

29-
Fill = 1,
28+
Fill = 1,
3029

31-
Bounce = 2,
30+
Bounce = 2,
3231

33-
Flat = 3,
32+
Flat = 3,
3433

35-
OneStroke = 4,
34+
OneStroke = 4,
3635

37-
Fade = 5
36+
Fade = 5
3837
}
3938

4039
declare const enum BEMBoxType {
4140

42-
Circle = 0,
41+
Circle = 0,
4342

44-
Square = 1
43+
Square = 1
4544
}
4645

47-
declare class BEMCheckBox extends UIView {
46+
declare class BEMCheckBox extends UIControl implements CAAnimationDelegate {
47+
48+
static alloc(): BEMCheckBox; // inherited from NSObject
49+
50+
static appearance(): BEMCheckBox; // inherited from UIAppearance
51+
52+
static appearanceForTraitCollection(trait: UITraitCollection): BEMCheckBox; // inherited from UIAppearance
53+
54+
static appearanceForTraitCollectionWhenContainedIn(trait: UITraitCollection, ContainerClass: typeof NSObject): BEMCheckBox; // inherited from UIAppearance
55+
56+
static appearanceForTraitCollectionWhenContainedInInstancesOfClasses(trait: UITraitCollection, containerTypes: NSArray<typeof NSObject>): BEMCheckBox; // inherited from UIAppearance
57+
58+
static appearanceWhenContainedIn(ContainerClass: typeof NSObject): BEMCheckBox; // inherited from UIAppearance
59+
60+
static appearanceWhenContainedInInstancesOfClasses(containerTypes: NSArray<typeof NSObject>): BEMCheckBox; // inherited from UIAppearance
61+
62+
static new(): BEMCheckBox; // inherited from NSObject
63+
64+
animationDuration: number;
65+
66+
boxType: BEMBoxType;
67+
68+
cornerRadius: number;
69+
70+
delegate: BEMCheckBoxDelegate;
71+
72+
readonly group: BEMCheckBoxGroup;
73+
74+
hideBox: boolean;
75+
76+
lineWidth: number;
77+
78+
minimumTouchSize: CGSize;
4879

49-
static appearance(): BEMCheckBox; // inherited from UIAppearance
80+
offAnimationType: BEMAnimationType;
5081

51-
static appearanceForTraitCollection(trait: UITraitCollection): BEMCheckBox; // inherited from UIAppearance
82+
offFillColor: UIColor;
5283

53-
static appearanceForTraitCollectionWhenContainedIn(trait: UITraitCollection, ContainerClass: typeof NSObject): BEMCheckBox; // inherited from UIAppearance
84+
on: boolean;
5485

55-
//static appearanceForTraitCollectionWhenContainedInInstancesOfClasses(trait: UITraitCollection, containerTypes: NSArray<typeof NSObject>): BEMCheckBox; // inherited from UIAppearance
86+
onAnimationType: BEMAnimationType;
5687

57-
static appearanceWhenContainedIn(ContainerClass: typeof NSObject): BEMCheckBox; // inherited from UIAppearance
88+
onCheckColor: UIColor;
5889

59-
//static appearanceWhenContainedInInstancesOfClasses(containerTypes: NSArray<typeof NSObject>): BEMCheckBox; // inherited from UIAppearance
90+
onFillColor: UIColor;
6091

61-
animationDuration: number;
92+
onTintColor: UIColor;
6293

63-
boxType: BEMBoxType;
94+
readonly debugDescription: string; // inherited from NSObjectProtocol
6495

65-
delegate: BEMCheckBoxDelegate;
96+
readonly description: string; // inherited from NSObjectProtocol
6697

67-
hideBox: boolean;
98+
readonly hash: number; // inherited from NSObjectProtocol
6899

69-
lineWidth: number;
100+
readonly isProxy: boolean; // inherited from NSObjectProtocol
70101

71-
minimumTouchSize: CGSize;
102+
readonly superclass: typeof NSObject; // inherited from NSObjectProtocol
72103

73-
offAnimationType: BEMAnimationType;
104+
readonly // inherited from NSObjectProtocol
74105

75-
on: boolean;
106+
animationDidStart(anim: CAAnimation): void;
76107

77-
onAnimationType: BEMAnimationType;
108+
animationDidStopFinished(anim: CAAnimation, flag: boolean): void;
78109

79-
onCheckColor: UIColor;
110+
class(): typeof NSObject;
80111

81-
onFillColor: UIColor;
112+
conformsToProtocol(aProtocol: any /* Protocol */): boolean;
82113

83-
onTintColor: UIColor;
114+
isEqual(object: any): boolean;
84115

85-
constructor(o: { coder: NSCoder; }); // inherited from NSCoding
116+
isKindOfClass(aClass: typeof NSObject): boolean;
86117

87-
constructor(o: { frame: CGRect; }); // inherited from UIView
118+
isMemberOfClass(aClass: typeof NSObject): boolean;
88119

89-
reload(): void;
120+
performSelector(aSelector: string): any;
90121

91-
self(): BEMCheckBox; // inherited from NSObjectProtocol
122+
performSelectorWithObject(aSelector: string, object: any): any;
92123

93-
setOnAnimated(on: boolean, animated: boolean): void;
124+
performSelectorWithObjectWithObject(aSelector: string, object1: any, object2: any): any;
125+
126+
reload(): void;
127+
128+
respondsToSelector(aSelector: string): boolean;
129+
130+
retainCount(): number;
131+
132+
self(): this;
133+
134+
setOnAnimated(on: boolean, animated: boolean): void;
94135
}
95136

96137
interface BEMCheckBoxDelegate extends NSObjectProtocol {
97138

98-
animationDidStopForCheckBox?(checkBox: BEMCheckBox): void;
139+
animationDidStopForCheckBox?(checkBox: BEMCheckBox): void;
99140

100-
didTapCheckBox?(checkBox: BEMCheckBox): void;
141+
didTapCheckBox?(checkBox: BEMCheckBox): void;
101142
}
102143
declare var BEMCheckBoxDelegate: {
103144

104-
prototype: BEMCheckBoxDelegate;
145+
prototype: BEMCheckBoxDelegate;
105146
};
106147

148+
declare class BEMCheckBoxGroup extends NSObject {
149+
150+
static alloc(): BEMCheckBoxGroup; // inherited from NSObject
151+
152+
static groupWithCheckBoxes(checkBoxes: NSArray<BEMCheckBox>): BEMCheckBoxGroup;
153+
154+
static new(): BEMCheckBoxGroup; // inherited from NSObject
155+
156+
readonly checkBoxes: NSHashTable<any>;
157+
158+
mustHaveSelection: boolean;
159+
160+
selectedCheckBox: BEMCheckBox;
161+
162+
addCheckBoxToGroup(checkBox: BEMCheckBox): void;
163+
164+
removeCheckBoxFromGroup(checkBox: BEMCheckBox): void;
165+
}
166+
107167
declare var BEMCheckBoxVersionNumber: number;
108168

109-
//declare var BEMCheckBoxVersionString: interop.Reference<number>;
169+
declare var BEMCheckBoxVersionString: interop.Reference<number>;
110170

111171
declare class BEMPathManager extends NSObject {
112172

113-
static alloc(): BEMPathManager; // inherited from NSObject
114-
115-
static new(): BEMPathManager; // inherited from NSObject
173+
static alloc(): BEMPathManager; // inherited from NSObject
116174

117-
boxType: BEMBoxType;
175+
static new(): BEMPathManager; // inherited from NSObject
118176

119-
lineWidth: number;
177+
boxType: BEMBoxType;
120178

121-
size: number;
179+
cornerRadius: number;
122180

123-
constructor(); // inherited from NSObject
181+
lineWidth: number;
124182

125-
pathForBox(): UIBezierPath;
183+
size: number;
126184

127-
pathForCheckMark(): UIBezierPath;
185+
pathForBox(): UIBezierPath;
128186

129-
pathForFlatCheckMark(): UIBezierPath;
187+
pathForCheckMark(): UIBezierPath;
130188

131-
pathForLongCheckMark(): UIBezierPath;
189+
pathForFlatCheckMark(): UIBezierPath;
132190

133-
self(): BEMPathManager; // inherited from NSObjectProtocol
191+
pathForLongCheckMark(): UIBezierPath;
134192
}

angular/index.d.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

checkbox.ios.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/// <reference path="BEMCheckBox.d.ts" /> Needed for autocompletion and compilation.
2-
31
import { CheckBoxInterface } from "./index";
42
import {
53
Property,

demo/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
"nativescript": {
33
"id": "org.nativescript.demo",
44
"tns-android": {
5-
"version": "3.0.0"
5+
"version": "3.0.1"
66
},
77
"tns-ios": {
8-
"version": "3.0.0"
8+
"version": "3.0.1"
99
}
1010
},
1111
"dependencies": {
1212
"nativescript-checkbox": "file:..",
1313
"tns-core-modules": "^3.0.0"
1414
},
1515
"devDependencies": {
16-
"babel-traverse": "6.7.6",
17-
"babel-types": "6.7.7",
18-
"babylon": "6.7.0",
19-
"filewalker": "0.1.2",
16+
"babel-traverse": "6.24.1",
17+
"babel-types": "6.24.1",
18+
"babylon": "6.17.2",
19+
"filewalker": "0.1.3",
2020
"lazy": "1.0.11",
21-
"nativescript-dev-typescript": "^0.3.2",
21+
"nativescript-dev-typescript": "^0.4.5",
2222
"typescript": "^2.2.0",
2323
"tns-platform-declarations": "^3.0.0"
2424
}

gruntfile.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
module.exports = function (grunt) {
22
var localConfig = {
33
typeScriptDeclarations: [
4-
"**/*.d.ts",
5-
"!references.d.ts",
6-
"!BEMCheckBox.d.ts",
7-
"!node_modules/**/*.*",
8-
"!demo/**/*.*",
9-
"!demo-ng/**/*.*",
10-
"!bin/**/*.*"
4+
"index.d.ts",
5+
"BEMCheckBox.d.ts"
116
],
127
outDir: "bin/dist/"
13-
}
8+
};
149

1510
grunt.initConfig({
1611
clean: {
@@ -34,6 +29,15 @@ module.exports = function (grunt) {
3429
}
3530
}
3631
},
32+
podfile: {
33+
src: "platforms/ios/Podfile",
34+
dest: localConfig.outDir,
35+
options: {
36+
process: function (content, srcPath) {
37+
return content.substring(content.indexOf("\n") + 1)
38+
}
39+
}
40+
},
3741
readme: {
3842
src: "README.md",
3943
dest: localConfig.outDir,

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"typings": "index.d.ts",
77
"nativescript": {
88
"platforms": {
9-
"android": "3.0.0",
10-
"ios": "3.0.0"
9+
"android": "3.0.1",
10+
"ios": "3.0.1"
1111
}
1212
},
1313
"scripts": {
@@ -70,7 +70,7 @@
7070
"@angular/http": "~4.0.3",
7171
"@angular/platform-browser": "~4.0.3",
7272
"@angular/router": "~4.0.3",
73-
"rxjs":"~5.0.1",
73+
"rxjs": "~5.0.1",
7474
"zone.js": "~0.8.9",
7575
"nativescript-angular": "~3.0.0",
7676

@@ -86,4 +86,4 @@
8686
"peerDependencies": {
8787
"tns-core-modules": "^3.0.0"
8888
}
89-
}
89+
}

platforms/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pod 'BEMCheckBox'
1+
pod 'BEMCheckBox', '~> 1.4.1'

tsconfig.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@
1919
]
2020
}
2121
},
22-
"exclude": [
23-
"node_modules",
24-
"demo",
25-
"demo-ng",
26-
"bin"
22+
"include": [
23+
"index.d.ts",
24+
"BEMCheckBox.d.ts",
25+
"checkbox.android.ts",
26+
"checkbox.ios.ts",
27+
"angular/index.ts"
2728
]
2829
}

0 commit comments

Comments
 (0)