Skip to content

Commit 5892426

Browse files
committed
Added missing docs here and there
1 parent 16f47af commit 5892426

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

Sources/InterposeKit/Hooks/Hook.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ public final class Hook {
9999
self.strategy.class
100100
}
101101

102+
/// The scope of the hook, indicating whether it targets a method on a class or a specific
103+
/// object.
102104
public var scope: HookScope {
103105
self.strategy.scope
104106
}
@@ -238,6 +240,7 @@ extension Hook: CustomDebugStringConvertible {
238240
}
239241
}
240242

243+
/// Represents the current state of a hook during its lifecycle.
241244
public enum HookState: Equatable {
242245

243246
/// The hook is ready to be applied.
@@ -251,13 +254,13 @@ public enum HookState: Equatable {
251254

252255
}
253256

254-
/// Represents the target of a hook operation—either a class type or a specific object instance.
257+
/// Represents the target of a hook operation—either a class type or a specific object.
255258
internal enum HookTarget {
256259

257260
/// A hook targeting a method defined on a class, either an instance method or a class method.
258261
case `class`(AnyClass, MethodKind)
259262

260-
/// A hook targeting a method on a specific object instance.
263+
/// A hook targeting a method on a specific object.
261264
case object(NSObject)
262265

263266
}

Sources/InterposeKit/Hooks/HookScope.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import ObjectiveC
22

3+
/// Defines what the scope of a hook—either a class (with method kind) or a specific object.
4+
/// This complements the class and selector when setting up a hook.
35
public enum HookScope {
46

57
/// The scope that targets a method on a class type (instance or class method).
68
case `class`(MethodKind)
79

8-
/// The scope that targets a specific object instance.
10+
/// The scope that targets a specific object.
911
case object(NSObject)
1012

1113
}

Sources/InterposeKit/InterposeError.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Foundation
22

3+
/// An error representing failure to prepare, apply, or revert a hook.
34
public enum InterposeError: Error, @unchecked Sendable {
45

56
/// A hook operation failed and the hook is no longer usable.

Sources/InterposeKit/MethodKind.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/// A specification of the method kind: instance or class.
12
public enum MethodKind: Equatable {
23

34
/// An instance method, e.g. `-[MyClass doSomething]`.

0 commit comments

Comments
 (0)